Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from jcbhmr/change-install-folder
Browse files Browse the repository at this point in the history
Change install folder
  • Loading branch information
jcbhmr authored May 29, 2023
2 parents b224f55 + bfe04ef commit f8ebfdf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deno wrapper

🦕 Like `./gradlew`, but for [Deno]
🦕 Like [`./gradlew`], but for [Deno]

<div align="center">

Expand All @@ -21,7 +21,8 @@ Windows support!
![curl](https://img.shields.io/static/v1?style=for-the-badge&message=curl&color=073551&logo=curl&logoColor=FFFFFF&label=)
![sh](https://img.shields.io/static/v1?style=for-the-badge&message=sh&color=4EAA25&logo=GNU+Bash&logoColor=FFFFFF&label=)

Find your existing Deno project, then run `install.sh`:
Find your existing Deno project, then run `install.sh`. If you're using Windows,
you can use [Git Bash] to emulate a POSIX shell. 👍

```sh
curl -fsSL https://deno.land/x/deno_wrapper/deno_wrapper.sh | sh
Expand Down Expand Up @@ -65,6 +66,8 @@ invoking and change it manually.

### Why?

💡 Inspired by [The Gradle Wrapper]

Sometimes (not often, but sometimes), you want to have an auto-install wrapper
around a project-critical binary. In a nutshell you gain the following benefits:

Expand Down Expand Up @@ -99,4 +102,6 @@ actually recieved the payload from the Release event!
[Deno]: https://deno.com/runtime
[github will even block files larger than 100mb]: https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github
[Git Bash]: https://gitforwindows.org/
[`./gradlew`]: https://github.com/gradle/gradle/blob/master/gradlew
[The Gradle Wrapper]: https://docs.gradle.org/current/userguide/gradle_wrapper.html
<!-- prettier-ignore-end -->
9 changes: 6 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ denow=$(cat <<'EOF'
# MIT License
# Copyright (c) 2023 Jacob Hummer
set -e
# https://stackoverflow.com/a/29835459
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
deno_dir="$script_dir/.deno"
# https://manpages.ubuntu.com/manpages/kinetic/en/man1/chronic.1.html
chronic() (
Expand All @@ -30,14 +33,14 @@ chronic() (
return "$exit_code"
)
if [ ! -d .deno ]; then
if [ ! -d "$deno_dir" ]; then
# https://github.com/denoland/deno_install#readme
export DENO_INSTALL=.deno
export DENO_INSTALL=$deno_dir
curl -fsSL https://deno.land/x/install/install.sh | chronic sh -s "v{{pinned}}"
fi
# https://github.com/denoland/deno_install/blob/master/install.sh#L53
export DENO_INSTALL=.deno
export DENO_INSTALL=$deno_dir
export PATH="$DENO_INSTALL/bin:$PATH"
exec deno "$@"
Expand Down

0 comments on commit f8ebfdf

Please sign in to comment.