Skip to content

Commit 38bdb63

Browse files
committed
reformat
1 parent 9e41353 commit 38bdb63

1 file changed

Lines changed: 55 additions & 55 deletions

File tree

local/etc/uceap.d/devcontainer_on_create.sh

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
11
function devcontainer_on_create() {
2-
# Change default umask and add user to web group so we can share write permission on web files
3-
sed -i 's/^#umask\s*022/umask 002/' ~/.profile
4-
echo "umask 002" >> ~/.zshrc
5-
echo "umask 002" >> ~/.bashrc
2+
# Change default umask and add user to web group so we can share write permission on web files
3+
sed -i 's/^#umask\s*022/umask 002/' ~/.profile
4+
echo "umask 002" >>~/.zshrc
5+
echo "umask 002" >>~/.bashrc
66

7-
sudo sh -c "cat >> /etc/apache2/sites-available/000-default.conf" <<-EOF
7+
sudo sh -c "cat >> /etc/apache2/sites-available/000-default.conf" <<-EOF
88
<Directory /var/www/html>
99
AllowOverride All
1010
</Directory>
1111
EOF
1212

13-
# This is how the example codespace changes the docroot. If it's good enough for them, it's good enough for me.
14-
sudo chmod a+x "$(pwd)" && sudo rm -rf /var/www/html && sudo ln -s "$(pwd)/web" /var/www/html
13+
# This is how the example codespace changes the docroot. If it's good enough for them, it's good enough for me.
14+
sudo chmod a+x "$(pwd)" && sudo rm -rf /var/www/html && sudo ln -s "$(pwd)/web" /var/www/html
1515

16-
# Setup database if MYSQL_HOST = 127.0.0.1
17-
cat > ~/.my.cnf <<-EOF
16+
# Setup database if MYSQL_HOST = 127.0.0.1
17+
cat >~/.my.cnf <<-EOF
1818
[client]
1919
host="$MYSQL_HOST"
2020
user="$MYSQL_USER"
2121
password="$MYSQL_PASSWORD"
2222
EOF
2323

24-
# translate mysql env vars to our template vars
25-
export DB_HOST="$MYSQL_HOST" DB_PORT="$MYSQL_TCP_PORT" DB_USER="$MYSQL_USER" DB_PASSWORD="$MYSQL_PASSWORD" DB_NAME="$MYSQL_DATABASE"
24+
# translate mysql env vars to our template vars
25+
export DB_HOST="$MYSQL_HOST" DB_PORT="$MYSQL_TCP_PORT" DB_USER="$MYSQL_USER" DB_PASSWORD="$MYSQL_PASSWORD" DB_NAME="$MYSQL_DATABASE"
2626

27-
# Setup our Drupal app
28-
composer dev-initialize-local
29-
cat >> web/sites/default/settings.local.php <<-EOF
27+
# Setup our Drupal app
28+
composer dev-initialize-local
29+
cat >>web/sites/default/settings.local.php <<-EOF
3030
\$settings['trusted_host_patterns'] = [];
3131
3232
# make drupal play nice with codespace proxy
3333
\$settings['reverse_proxy'] = TRUE;
3434
\$settings['reverse_proxy_addresses'] = array(\$_SERVER['REMOTE_ADDR']);
3535
EOF
3636

37-
composer install
38-
composer compile-theme
39-
40-
# Set file permissions so both httpd and user can write to files
41-
chgrp www-data web/sites/default/files
42-
chmod g+s web/sites/default/files
43-
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-
# The database image might be out of date so deploy any new changes from code
54-
vendor/bin/drush deploy
55-
56-
# Setup drush and other vendor binaries
57-
echo "export PATH=\"`pwd`/vendor/bin:\$PATH\"" | tee -a ~/.bashrc ~/.zshrc ~/.zshrc.local
58-
59-
# Setup VS Code
60-
mkdir -p $WORKSPACE_FOLDER/.vscode
61-
cp /usr/local/share/vscode/* $WORKSPACE_FOLDER/.vscode/
62-
63-
# Install Claude Code
64-
sudo npm install -g @anthropic-ai/claude-code
65-
66-
# Setup shell completion
67-
uceap completion bash | sudo sh -c "cat > /etc/bash_completion.d/uceap"
68-
gh completion --shell bash | sudo sh -c "cat > /etc/bash_completion.d/gh"
69-
uceap completion zsh | sudo sh -c "cat > /usr/local/share/zsh/site-functions/_uceap"
70-
gh completion --shell zsh | sudo sh -c "cat > /usr/local/share/zsh/site-functions/_gh"
71-
# Force loading of the completion script because I can't get it to autoload
72-
echo "autoload -Uz _uceap && compdef _uceap uceap" | tee -a ~/.zshrc ~/.zshrc.local
73-
74-
# Run local devcontainer lifecycle scripts
75-
if [ -x .devcontainer/onCreate.sh ]; then
76-
.devcontainer/onCreate.sh
77-
fi
37+
composer install
38+
composer compile-theme
39+
40+
# Set file permissions so both httpd and user can write to files
41+
chgrp www-data web/sites/default/files
42+
chmod g+s web/sites/default/files
43+
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+
# The database image might be out of date so deploy any new changes from code
54+
vendor/bin/drush deploy
55+
56+
# Setup drush and other vendor binaries
57+
echo "export PATH=\"$(pwd)/vendor/bin:\$PATH\"" | tee -a ~/.bashrc ~/.zshrc ~/.zshrc.local
58+
59+
# Setup VS Code
60+
mkdir -p $WORKSPACE_FOLDER/.vscode
61+
cp /usr/local/share/vscode/* $WORKSPACE_FOLDER/.vscode/
62+
63+
# Install Claude Code
64+
sudo npm install -g @anthropic-ai/claude-code
65+
66+
# Setup shell completion
67+
uceap completion bash | sudo sh -c "cat > /etc/bash_completion.d/uceap"
68+
gh completion --shell bash | sudo sh -c "cat > /etc/bash_completion.d/gh"
69+
uceap completion zsh | sudo sh -c "cat > /usr/local/share/zsh/site-functions/_uceap"
70+
gh completion --shell zsh | sudo sh -c "cat > /usr/local/share/zsh/site-functions/_gh"
71+
# Force loading of the completion script because I can't get it to autoload
72+
echo "autoload -Uz _uceap && compdef _uceap uceap" | tee -a ~/.zshrc ~/.zshrc.local
73+
74+
# Run local devcontainer lifecycle scripts
75+
if [ -x .devcontainer/onCreate.sh ]; then
76+
.devcontainer/onCreate.sh
77+
fi
7878
}
7979

8080
_devcontainer_on_create_desc='runs when the devcontainer is created'

0 commit comments

Comments
 (0)