Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dpmland/monk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.1.0
Choose a base ref
...
head repository: dpmland/monk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 1 commit
  • 7 files changed
  • 1 contributor

Commits on Jul 24, 2023

  1. Copy the full SHA
    b09f88f View commit details
Showing with 83 additions and 24 deletions.
  1. +1 −1 .editorconfig
  2. +4 −0 .vscode/settings.json
  3. +62 −0 deno.lock
  4. +2 −2 mod.ts
  5. +2 −2 src/compiler.ts
  6. +3 −3 src/copy.ts
  7. +9 −16 src/utils.ts
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
root = true

[*]
end_of_line = lf
end_of_line = crlf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"deno.enable": true,
"deno.unstable": true
}
62 changes: 62 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

interface MonkTypes {
versions: {
4 changes: 2 additions & 2 deletions src/compiler.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright © 2022 Dpm Land. All Rights Reserved.

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

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

export interface BinaryCopyOptions {
version: 'stable' | 'canary';
25 changes: 9 additions & 16 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
// Copyright © 2022 Dpm Land. All Rights Reserved.
import * as colors from 'https://deno.land/std@0.158.0/fmt/colors.ts';
import { join } from 'https://deno.land/std@0.158.0/path/mod.ts';
import { dracoFiles } from 'https://deno.land/x/draco@0.1.3/mod.ts';
import * as colors from 'https://deno.land/std@0.195.0/fmt/colors.ts';
import { join } from 'https://deno.land/std@0.195.0/path/mod.ts';
import * as dir from 'https://deno.land/x/dir@1.5.1/mod.ts';

export async function Run(command: string) {
console.log(`${colors.dim('$')} ${colors.bold(command)}`);
const cmd = command.split(' ');
const run = Deno.run({
cmd: cmd,
stdout: 'piped',
stderr: 'piped',
});
const run = new Deno.Command(cmd[0], { args: cmd.slice(1) });

const { code } = await run.status();
const result = await run.output();

// Piped outs
const rawErr = await run.stderrOutput();

if (code !== 0) {
if (result.code !== 0) {
console.error(
`The command was not executed correctly:\n${
colors.dim(command)
}\n - Error Detailed:\n${
colors.red(colors.bold(new TextDecoder().decode(rawErr)))
colors.red(colors.bold(new TextDecoder().decode(result.stderr)))
}`,
);
Deno.exit(code);
Deno.exit(result.code);
}
}

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

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