1
0
Fork 0
This commit is contained in:
Michaël Lemaire 2022-05-31 20:32:48 +02:00
parent 74f4be962e
commit 6f0d4cabcd
6 changed files with 35 additions and 13 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
deno.d.ts
.vscode
.local
.output
web/*.js

2
cli.ts
View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S deno run --allow-run --allow-read --allow-env
#!./run
import { showZenityUI } from "./ui/zenity.ts";
if (import.meta.main) {

1
config/run.flags Normal file
View File

@ -0,0 +1 @@
--allow-env=CWD,HOME --allow-read=.local/config.json --allow-run=zenity,xclip

View File

@ -268,7 +268,7 @@ export class Hasher {
s += sInput.substring(i, i + j);
}
s += String.fromCharCode((seed + i) % 26 + 65);
i += (j + 1);
i += j + 1;
}
if (i < sInput.length) {
@ -296,7 +296,7 @@ export class Hasher {
s += sInput.substring(i, i + j);
}
s += String.fromCharCode((seed + sInput.charCodeAt(i)) % 10 + 48);
i += (j + 1);
i += j + 1;
}
if (i < sInput.length) {

19
run Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
# Simplified run tool for deno commands
if test $# -eq 0
then
echo "Usage: $0 [file or command]"
exit 1
elif echo $1 | grep -q '.*.ts'
then
denocmd=run
denoargs=$1
shift
else
denocmd=$1
shift
fi
denoargs="$(cat config/$denocmd.flags 2> /dev/null) $denoargs $@"
exec deno $denocmd $denoargs