Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
alshdavid committed May 21, 2024
1 parent b87dfd1 commit e38f663
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-env/generate.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -e

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ROOT_DIR=$(dirname $(dirname $SCRIPT_DIR))
ROOT_DIR=$(dirname $(dirname $(dirname $SCRIPT_DIR)))

ls -l $ROOT_DIR
cd $ROOT_DIR
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/setup-env/setup-env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ROOT_DIR=$(dirname $(dirname $SCRIPT_DIR))
ROOT_DIR=$(dirname $(dirname $(dirname $SCRIPT_DIR)))

cd $ROOT_DIR

Expand All @@ -24,7 +24,7 @@ ENV_PATH="${ROOT_DIR}/.env"

if [ ! -f "$ENV_PATH" ]; then
echo "missing ${ENV_PATH}"
exit 1
exit 0
fi

echo "Reading $ENV_PATH"
Expand Down
15 changes: 10 additions & 5 deletions .github/actions/setup-env/setup-env.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ $env:Path = $HOME + '\.local\nodejs\prefix\bin;' + $env:Path
$env:NPM_CONFIG_PREFIX = $HOME + '\.local\nodejs\prefix'
pnpm config set store-dir $HOME/.local/nodejs/pnpm-store

Get-Content "${env:RootPath}\.env" | foreach {
$name, $value = $_.split('=')
if ([string]::IsNullOrWhiteSpace($name) || $name.Contains('#')) {
continue
if (Test-Path "${env:RootPath}\.env") {
echo "Loading .env"
Get-Content "${env:RootPath}\.env" | foreach {
$name, $value = $_.split('=')
if ([string]::IsNullOrWhiteSpace($name) || $name.Contains('#')) {
continue
}
echo "Setting $name = $value"
Set-Item "env:$name" "$value"
}
Set-Item "env:$name" "$value"
}

0 comments on commit e38f663

Please sign in to comment.