Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetcanozcan committed Aug 28, 2020
0 parents commit 63ecec5
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.*/
3 changes: 3 additions & 0 deletions bin/duke.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import start from "../start.ts";

start(Deno.args);
23 changes: 23 additions & 0 deletions dukefile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const dukefileName = "./dukefile.ts";

let dukefilePath = await Deno.realPath(dukefileName);

switch (Deno.build.os) {
case "windows":
dukefilePath = dukefilePath.slice("c:".length);
break;

default:
break;
}

let dukefile: { [key: string]: Function };

try {
dukefile = await import(dukefilePath);
} catch (err) {
console.error("Can not read dukefile", err);
Deno.exit(1);
}

export default dukefile;
10 changes: 10 additions & 0 deletions start.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import dukefile from "./dukefile.ts";

export default function start(args: string[]) {
const taskName = args[0] || "default";
const task = dukefile[taskName];
const taskArgs = args.slice(1);

// Run task
task(...taskArgs);
}
39 changes: 39 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
"esModuleInterop": true,
"lib": [
"esnext"
],
"module": "amd",
"moduleResolution": "node",
"noEmit": true,
"paths": {
// Paths have to be relative to `baseUrl`
"http://*": [
// This is the OSX location (assumine root is two levels up)
"../../Library/Caches/deno/deps/http/*",
// This is the typical location a Linux
"../../.cache/deno/deps/http/*"
],
"https://*": [
// This is the OSX location (assumine root is two levels up)
"../../Library/Caches/deno/deps/https/*",
// This is the typical location a Linux
"../../.cache/deno/deps/https/*"
]
},
"plugins": [
{
"name": "deno_ls_plugin"
}
],
"pretty": true,
"resolveJsonModule": true,
"target": "esnext"
},
"include": [
"./**/*.ts"
]
}

0 comments on commit 63ecec5

Please sign in to comment.