Skip to content

Commit

Permalink
fix(nano): use relative __hyper__ dir for storage and write permissions
Browse files Browse the repository at this point in the history
Before, this was using `Deno.env.get("TMPDIR")`, but since `TMPDIR`
can change, there wasn't a way to compile
hyper nano into a binary with specific write permissions a predetermined
directory.
  • Loading branch information
TillaTheHun0 committed Apr 21, 2022
1 parent 984677a commit 7324cc7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.env
.eslintcache
__hyper__
8 changes: 4 additions & 4 deletions images/nano/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ clean:
@rm -rf ./build

compile-linux:
@deno compile --target=x86_64-unknown-linux-gnu --allow-env --allow-read --allow-write=/tmp/hyper --allow-net --unstable --no-check=remote --output ./build/hyper-x86_64-unknown-linux-gnu mod.js
@deno compile --target=x86_64-unknown-linux-gnu --allow-env --allow-read --allow-write=__hyper__ --allow-net --unstable --no-check=remote --output ./build/hyper-x86_64-unknown-linux-gnu mod.js

compile-apple:
@deno compile --target=x86_64-apple-darwin --allow-env --allow-read --allow-write=/tmp/hyper --allow-net --unstable --no-check=remote --output ./build/hyper-x86_64-apple-darwin mod.js
@deno compile --target=x86_64-apple-darwin --allow-env --allow-read --allow-write=__hyper__ --allow-net --unstable --no-check=remote --output ./build/hyper-x86_64-apple-darwin mod.js

compile-arch-apple:
@deno compile --target=aarch64-apple-darwin --allow-env --allow-read --allow-write=/tmp/hyper --allow-net --unstable --no-check=remote --output ./build/hyper-aarch64-apple-darwin mod.js
@deno compile --target=aarch64-apple-darwin --allow-env --allow-read --allow-write=__hyper__ --allow-net --unstable --no-check=remote --output ./build/hyper-aarch64-apple-darwin mod.js

compile-windows:
@deno compile --target=x86_64-pc-windows-msvc --allow-env --allow-read --allow-write=/tmp/hyper --allow-net --unstable --no-check=remote --output ./build/hyper-x86_64-pc-windows-msvc mod.js
@deno compile --target=x86_64-pc-windows-msvc --allow-env --allow-read --allow-write=__hyper__ --allow-net --unstable --no-check=remote --output ./build/hyper-x86_64-pc-windows-msvc mod.js
3 changes: 1 addition & 2 deletions images/nano/dir.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { join } from "./deps.js";

const TMPDIR = Deno.env.get("TMPDIR") || "/tmp";
export const DIR = join(TMPDIR, "hyper");
export const DIR = join(".", "__hyper__");

export async function reload(purge = false) {
if (purge) {
Expand Down

0 comments on commit 7324cc7

Please sign in to comment.