Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "choosealicense.com",
"postCreateCommand": "bash .devcontainer/post-create.sh"
}
60 changes: 60 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
set -euo pipefail

if ! command -v curl >/dev/null 2>&1; then
echo "curl is required to fetch GitHub Pages versions metadata"
exit 1
fi

if ! command -v ruby >/dev/null 2>&1; then
echo "ruby is required to parse GitHub Pages versions metadata"
exit 1
fi

pages_ruby_version="$({
curl -fsSL https://pages.github.com/versions.json
} | ruby -rjson -e 'print JSON.parse(STDIN.read).fetch("ruby")')"

if [[ -z "${pages_ruby_version}" ]]; then
echo "Could not determine Ruby version from https://pages.github.com/versions.json"
exit 1
fi

echo "GitHub Pages Ruby version: ${pages_ruby_version}"

if ! command -v git >/dev/null 2>&1; then
echo "git is required to initialize submodules"
exit 1
fi

echo "Initializing/updating git submodules"
git submodule update --init --recursive

# RVM scripts can reference internal variables before they are initialized,
# which fails under `set -u` (for example: `_system_name: unbound variable`).
# Temporarily disable nounset while sourcing and invoking RVM.
nounset_was_set=0
if [[ $- == *u* ]]; then
nounset_was_set=1
set +u
fi

if [[ -s /usr/local/rvm/scripts/rvm ]]; then
source /usr/local/rvm/scripts/rvm
elif [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
source "$HOME/.rvm/scripts/rvm"
else
echo "RVM was not found; unable to auto-install Ruby ${pages_ruby_version}"
exit 1
fi

rvm install "${pages_ruby_version}" --quiet-curl
rvm use "${pages_ruby_version}"
rvm alias create default "${pages_ruby_version}"

if [[ "${nounset_was_set}" -eq 1 ]]; then
set -u
fi

gem install bundler --no-document
bundle install
2 changes: 1 addition & 1 deletion _licenses/gpl-2.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ how: Create a text file (typically named LICENSE or LICENSE.txt) in the root of
note: The Free Software Foundation recommends taking the additional step of adding a boilerplate notice to the top of each file. The boilerplate can be found at the end of the license.

using:
AliSQL: https://github.com/alibaba/AliSQL/blob/master/COPYING
Discourse: https://github.com/discourse/discourse/blob/master/LICENSE.txt
Jellyfin: https://github.com/jellyfin/jellyfin/blob/master/LICENSE
OBS Studio: https://github.com/obsproject/obs-studio/blob/master/COPYING

permissions:
- commercial-use
Expand Down
2 changes: 1 addition & 1 deletion _licenses/gpl-3.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ note: The Free Software Foundation recommends taking the additional step of addi
using:
Ansible: https://github.com/ansible/ansible/blob/devel/COPYING
Bash: https://git.savannah.gnu.org/cgit/bash.git/tree/COPYING
GIMP: https://git.gnome.org/browse/gimp/tree/COPYING
uBlock Origin: https://github.com/gorhill/uBlock/blob/master/LICENSE.txt

permissions:
- commercial-use
Expand Down
Loading