-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.ts
26 lines (21 loc) · 929 Bytes
/
install.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import help from './help.ts';
import {red} from 'https://deno.land/std@0.216.0/fmt/colors.ts';
if (Deno.build.os != 'windows') {
console.error(red('Wincompile is for Windows only.'));
Deno.exit(1);
}
const {stdout, stderr} = new Deno.Command(Deno.execPath(), {
args: ['install', '--force', '--allow-read', '--allow-write', '--allow-run', '--no-config', '--no-lock',
'--import-map=https://deno.land/x/wincompile/import_map.json',
'--reload=https://deno.land/x/wincompile/',
'--allow-env="DENO_DIR,LOCALAPPDATA"',
'--allow-net="raw.githubusercontent.com/Leokuma/wincompile/,github.com/electron/rcedit/releases/,objects.githubusercontent.com/"',
'https://deno.land/x/wincompile/wincompile.ts'
],
stdout: 'piped',
stderr: 'piped',
}).outputSync();
const txtDec = new TextDecoder();
if (stdout.length) console.log(txtDec.decode(stdout));
if (stderr.length) console.error(txtDec.decode(stderr));
console.log(help);