File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ function _terminus_login() {
2+ if [ -z " $TERMINUS_TOKEN " ]; then
3+ # Fallback to DEVOPS_TERMINUS_TOKEN if personal token is not set (intended for Codespaces).
4+ if [ -z " $DEVOPS_TERMINUS_TOKEN " ]; then
5+ echo " Please set the TERMINUS_TOKEN environment variable."
6+ exit 1
7+ fi
8+ export TERMINUS_TOKEN=$DEVOPS_TERMINUS_TOKEN
9+ fi
10+ terminus auth:login --machine-token=$TERMINUS_TOKEN
11+ }
Original file line number Diff line number Diff line change @@ -41,6 +41,16 @@ function devcontainer_on_create() {
4141 chgrp www-data web/sites/default/files
4242 chmod g+s web/sites/default/files
4343
44+ # Download files
45+ _terminus_login
46+ TERMINUS_ENV=" dev" terminus backup:get --element=files --to=files.tar.gz
47+ tar zx --no-same-permissions --strip-components 1 -C web/sites/default/files -f files.tar.gz
48+ rm files.tar.gz
49+ # no-same-permissions doesn't seem to work so we fix it here
50+ sudo find web/sites/default/files -type d -exec chmod g+ws {} +
51+ sudo find web/sites/default/files -type f -exec chmod g+w {} +
52+
53+
4454 # Setup drush and other vendor binaries
4555 echo " export PATH=\" ` pwd` /vendor/bin:\$ PATH\" " | tee -a ~ /.bashrc ~ /.zshrc ~ /.zshrc.local
4656
Original file line number Diff line number Diff line change 11function devcontainer_post_create() {
2- # Authenticate to Pantheon iff the user set a token env var
3- if [[ -n " $TERMINUS_TOKEN " ]]; then
4- terminus -n auth:login --machine-token=" $TERMINUS_TOKEN "
5- fi
6-
72 # Install GitHub CLI Copilot Extension
83 if [[ -n " $GH_TOKEN " ]] || [[ -n " $GITHUB_TOKEN " ]] ; then
94 gh extension install github/gh-copilot
You can’t perform that action at this time.
0 commit comments