Skip to content

Commit

Permalink
Use remote config and lock file
Browse files Browse the repository at this point in the history
  • Loading branch information
mono0x committed Jun 1, 2024
1 parent b49ef10 commit 66d13aa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
8 changes: 4 additions & 4 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ if (-not (Test-Path "$env:DENO_INSTALL\bin\deno.exe")) {
Invoke-RestMethod https://deno.land/install.ps1 | Invoke-Expression
}

$url = $env:GITHUB_ACTIONS -eq "true" `
? ".\install\main.ts" `
: "https://raw.githubusercontent.com/mono0x/dotfiles/main/install/main.ts"
$prefix = $env:GITHUB_ACTIONS -eq "true" `
? "." `
: "https://raw.githubusercontent.com/mono0x/dotfiles/main/"

. "$env:DENO_INSTALL\bin\deno.exe" run -A "$url"
. "$env:DENO_INSTALL\bin\deno.exe" run -A --config "$prefix/deno.jsonc" --lock "$prefix/deno.lock" "$prefix/install/main.ts"
19 changes: 10 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ set -eu

cd "$(dirname "$0")"

DENO_INSTALL="$HOME/.local"
command -v "$DENO_INSTALL/bin/deno" > /dev/null 2>&1 || \
DENO_INSTALL="$DENO_INSTALL" sh -c "$(curl -fsSL https://deno.land/x/install/install.sh)"


if [ "${GITHUB_ACTIONS:-}" = "true" ]
deno=""
if command -v deno > /dev/null 2>&1
then
url="install/main.ts"
deno="deno"
else
url="https://raw.githubusercontent.com/mono0x/dotfiles/main/install/main.ts"
DENO_INSTALL="$HOME/.local"
DENO_INSTALL="$DENO_INSTALL" sh -c "$(curl -fsSL https://deno.land/x/install/install.sh)"
deno="$DENO_INSTALL/bin/deno"
fi

exec "$DENO_INSTALL/bin/deno" run -A "$url"
prefix="."
[ "${GITHUB_ACTIONS:-}" = "true" ] && prefix="https://raw.githubusercontent.com/mono0x/dotfiles"

exec "$deno" run --config "$prefix/deno.jsonc" --lock "$prefix/deno.lock" -A "$prefix/install/main.ts"

0 comments on commit 66d13aa

Please sign in to comment.