Skip to content

Commit b09f88f

Browse files
author
Teo
committed
fix(run-updates): fix all bugs with the new updates
1 parent 4fa5d8b commit b09f88f

File tree

7 files changed

+83
-24
lines changed

7 files changed

+83
-24
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
root = true
22

33
[*]
4-
end_of_line = lf
4+
end_of_line = crlf
55
insert_final_newline = true
66
charset = utf-8
77
trim_trailing_whitespace = true

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"deno.enable": true,
3+
"deno.unstable": true
4+
}

deno.lock

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { MoveTheBinary } from './src/copy.ts';
55
import figlet from 'https://x.nest.land/deno-figlet@0.0.5/mod.js';
66
import * as colors from 'https://deno.land/std@0.158.0/fmt/colors.ts';
77
/*
8-
* Add the Types for the Params in the Function!
9-
**/
8+
* Add the Types for the Params in the Function!
9+
*/
1010

1111
interface MonkTypes {
1212
versions: {

src/compiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright © 2022 Dpm Land. All Rights Reserved.
22

3-
import * as colors from 'https://deno.land/std@0.158.0/fmt/colors.ts';
3+
import * as colors from 'https://deno.land/std@0.195.0/fmt/colors.ts';
44
import { dracoFiles } from 'https://deno.land/x/draco@0.1.3/mod.ts';
5-
import { join } from 'https://deno.land/std@0.158.0/path/mod.ts';
5+
import { join } from 'https://deno.land/std@0.195.0/path/mod.ts';
66
import { Run, TEMP } from '../src/utils.ts';
77

88
export interface CompilerOptions {

src/copy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright © 2022 Dpm Land. All Rights Reserved.
2-
import * as colors from 'https://deno.land/std@0.158.0/fmt/colors.ts';
3-
import { join } from 'https://deno.land/std@0.158.0/path/mod.ts';
2+
import * as colors from 'https://deno.land/std@0.195.0/fmt/colors.ts';
3+
import { join } from 'https://deno.land/std@0.195.0/path/mod.ts';
44
import { BIN } from '../src/utils.ts';
55
import { dracoFiles, dracoInfo } from 'https://deno.land/x/draco@0.1.3/mod.ts';
6-
import { copy } from 'https://deno.land/std@0.158.0/fs/copy.ts';
6+
import { copy } from 'https://deno.land/std@0.195.0/fs/copy.ts';
77

88
export interface BinaryCopyOptions {
99
version: 'stable' | 'canary';

src/utils.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
// Copyright © 2022 Dpm Land. All Rights Reserved.
2-
import * as colors from 'https://deno.land/std@0.158.0/fmt/colors.ts';
3-
import { join } from 'https://deno.land/std@0.158.0/path/mod.ts';
4-
import { dracoFiles } from 'https://deno.land/x/draco@0.1.3/mod.ts';
2+
import * as colors from 'https://deno.land/std@0.195.0/fmt/colors.ts';
3+
import { join } from 'https://deno.land/std@0.195.0/path/mod.ts';
4+
import * as dir from 'https://deno.land/x/dir@1.5.1/mod.ts';
55

66
export async function Run(command: string) {
77
console.log(`${colors.dim('$')} ${colors.bold(command)}`);
88
const cmd = command.split(' ');
9-
const run = Deno.run({
10-
cmd: cmd,
11-
stdout: 'piped',
12-
stderr: 'piped',
13-
});
9+
const run = new Deno.Command(cmd[0], { args: cmd.slice(1) });
1410

15-
const { code } = await run.status();
11+
const result = await run.output();
1612

17-
// Piped outs
18-
const rawErr = await run.stderrOutput();
19-
20-
if (code !== 0) {
13+
if (result.code !== 0) {
2114
console.error(
2215
`The command was not executed correctly:\n${
2316
colors.dim(command)
2417
}\n - Error Detailed:\n${
25-
colors.red(colors.bold(new TextDecoder().decode(rawErr)))
18+
colors.red(colors.bold(new TextDecoder().decode(result.stderr)))
2619
}`,
2720
);
28-
Deno.exit(code);
21+
Deno.exit(result.code);
2922
}
3023
}
3124

3225
export const TEMP = join(Deno.makeTempDirSync(), '.monk');
3326

34-
export const BIN = join(dracoFiles.homeDir()!, '.deno', 'bin');
27+
export const BIN = join(dir.default('home')!, '.deno', 'bin');

0 commit comments

Comments
 (0)