generated from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
199 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
### Init directories | ||
caller_filename=$(ps -o args= $PPID) | ||
caller_filepath=$(readlink -f ${caller_filename##/bin/sh}) | ||
export source=$(dirname $caller_filepath) | ||
export feature=$(basename $source | sed 's/_.*$//') | ||
export target=${1:-/usr/local/share}/$feature | ||
|
||
### Create links to utils in /usr/local/bin | ||
find $target -type f -name "_*.sh" -exec echo {} \; -exec chmod +x {} \; | while read file | ||
do | ||
link=/usr/local/bin/$(basename $file | sed 's/^_//;s/.sh$//') | ||
ln -sf $file $link | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ done | |
|
||
### Install this feature | ||
$(dirname $0)/_install-feature.sh | ||
$(dirname $0)/_install-bin.sh |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ set -e | |
|
||
### Install this feature | ||
install-feature | ||
install-stubs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ set -e | |
|
||
### Install feature | ||
install-feature | ||
install-stubs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
workspace=${containerWorkspaceFolder:-${CODESPACE_VSCODE_FOLDER:-.}} | ||
[ -n "$LARAVEL_SAIL" ] && [ "$LARAVEL_SAIL" -eq 1 ] && sail artisan "$@" || php -d xdebug.mode=off $workspace/artisan "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
workspace=${containerWorkspaceFolder:-${CODESPACE_VSCODE_FOLDER:-.}} | ||
|
||
### Install composer dependencies if composer.json exists | ||
if [ -f $workspace/composer.json ]; then | ||
echo "Install composer dependencies" | npx --yes chalk-cli --stdin blue | ||
composer install --ansi --ignore-platform-reqs --no-interaction --no-progress | ||
fi | ||
|
||
### Install npm dependencies if package.json exists | ||
if [ -f $workspace/package.json ]; then | ||
echo "Install npm dependencies" | npx --yes chalk-cli --stdin blue | ||
npm install --ws --if-present --include-workspace-root || npm install | ||
fi | ||
|
||
### Init db if sqlite and not exists | ||
if [ -n "$DB_CONNECTION" ] && [ "$DB_CONNECTION" = "sqlite" ]; then | ||
|
||
### Set default sqlite db | ||
if [ -z "$DB_DATABASE" ]; then | ||
export DB_DATABASE=database/database.sqlite | ||
fi | ||
|
||
echo "Ensure sqlite db $DB_DATABASE exist" | npx --yes chalk-cli --stdin blue | ||
touch $workspace/$DB_DATABASE | ||
fi | ||
|
||
### Init env | ||
echo "Init dotenv" | npx --yes chalk-cli --stdin blue | ||
touch $workspace/.env | ||
|
||
### Add APP_KEY to .env if it does not exist, in one line | ||
grep -q "APP_KEY" $workspace/.env || echo APP_KEY=null >>$workspace/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
workspace=${containerWorkspaceFolder:-${CODESPACE_VSCODE_FOLDER:-.}} | ||
[ -n "$LARAVEL_SAIL" ] && [ "$LARAVEL_SAIL" -eq 1 ] && sail npm run "$@" || npm run "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
workspace=${containerWorkspaceFolder:-${CODESPACE_VSCODE_FOLDER:-.}} | ||
sh $([ -f sail ] && echo sail || echo $workspace/vendor/bin/sail) "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
art key:generate --force | ||
art migrate --seed --graceful --no-interaction | ||
art config:cache | ||
art view:cache | ||
art route:cache | ||
art event:cache | ||
art optimize:clear |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.