-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create seed version of "install-next" script
Just playing around at this point to see if I could make something that was very close to zero-dependencies (other than the language runtime and its standard library), unlike Ansible, which sits atop pile of Python infrastructure. Related: #82
- Loading branch information
Showing
4 changed files
with
47 additions
and
0 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,41 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
REPO_ROOT="${BASH_SOURCE%/*}" | ||
DENO_BASE="$REPO_ROOT/vendor/deno" | ||
DENO_INSTALLER="$DENO_BASE/install.sh" | ||
DENO_INSTALL="$DENO_BASE/local" | ||
DENO_EXE="$DENO_INSTALL/bin/deno" | ||
DENO_TYPES="$DENO_BASE/types.d.ts" | ||
|
||
for ARG in "$@"; do | ||
if [ "$ARG" = "--force" -o "$ARG" = "-f" ]; then | ||
FORCE=1 | ||
fi | ||
done | ||
|
||
if [[ ! -e "$DENO_INSTALLER" || $FORCE ]]; then | ||
echo "[status] Fetching Deno installer" | ||
command curl -fsSL -o "$DENO_INSTALLER" https://deno.land/x/install/install.sh | ||
else | ||
echo "[skip] Fetch Deno installer; use -f to force re-fetch" | ||
fi | ||
|
||
if [[ ! -e "$DENO_EXE" || $FORCE ]]; then | ||
echo "[status] Run Deno installer" | ||
export DENO_INSTALL | ||
command sh "$DENO_INSTALLER" | ||
else | ||
echo "[skip] Run Deno installer; use -f to force re-install" | ||
fi | ||
|
||
if [[ ! -e "$DENO_TYPES" || $FORCE ]]; then | ||
echo "[status] Generate Deno types" | ||
"$DENO_EXE" types > "$DENO_TYPES" | ||
else | ||
echo "[skip] Generate Deno types; use -f to force re-generation" | ||
fi | ||
|
||
echo "[status] Running main" | ||
"$DENO_EXE" run --allow-all lib/main.ts "$@" |
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,4 @@ | ||
// This is only for the benefit of the LanguageClient. | ||
import type Deno from '../vendor/deno/types.d.ts'; | ||
|
||
console.log(Deno.args); |
Empty file.
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,2 @@ | ||
* | ||
!/.gitignore |