Skip to content

Commit

Permalink
fix: 🐛 fix ln generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgrv committed Jan 2, 2025
1 parent 86a5145 commit 07612c3
Show file tree
Hide file tree
Showing 19 changed files with 217 additions and 223 deletions.
16 changes: 16 additions & 0 deletions src/common-utils/_install-bin.sh
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
2 changes: 1 addition & 1 deletion src/common-utils/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Common Utils",
"version": "1.1.5",
"version": "1.1.6",
"description": "Common utils for tomgrv/devcontainer-features",
"dependsOn": {
"ghcr.io/devcontainers/features/common-utils": {}
Expand Down
10 changes: 0 additions & 10 deletions src/common-utils/install-bin.sh

This file was deleted.

1 change: 1 addition & 0 deletions src/common-utils/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ done

### Install this feature
$(dirname $0)/_install-feature.sh
$(dirname $0)/_install-bin.sh
36 changes: 0 additions & 36 deletions src/gitutils/install-stubs.sh

This file was deleted.

1 change: 1 addition & 0 deletions src/gitutils/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ set -e

### Install this feature
install-feature
install-stubs
2 changes: 1 addition & 1 deletion src/gitversion/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "GitVersion feature",
"version": "3.0.1",
"version": "3.0.2",
"description": "Add gitversion to your devcontainer",
"dependsOn": {
"ghcr.io/devcontainers/features/dotnet": "",
Expand Down
36 changes: 0 additions & 36 deletions src/gitversion/install-stubs.sh

This file was deleted.

1 change: 1 addition & 0 deletions src/gitversion/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ set -e

### Install feature
install-feature
install-stubs
5 changes: 5 additions & 0 deletions src/larasets/_art.sh
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 "$@"
35 changes: 35 additions & 0 deletions src/larasets/_init.sh
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
5 changes: 5 additions & 0 deletions src/larasets/_run.sh
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 "$@"
5 changes: 5 additions & 0 deletions src/larasets/_sail.sh
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 || [ -f "$workspace/vendor/bin/sail" ] && echo $workspace/vendor/bin/sail) "$@"
10 changes: 10 additions & 0 deletions src/larasets/_seed.sh
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
49 changes: 0 additions & 49 deletions src/larasets/configure-aliases.sh

This file was deleted.

60 changes: 0 additions & 60 deletions src/larasets/configure-project.sh

This file was deleted.

10 changes: 10 additions & 0 deletions src/larasets/configure-sail.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -e

### Init workspace
init

### Build sail if needed
if [ -n "$LARAVEL_SAIL" ] && [ "$LARAVEL_SAIL" -eq 1 ]; then
sail build --no-cache
fi
Loading

0 comments on commit 07612c3

Please sign in to comment.