Skip to content

Commit

Permalink
Add --version option to observable command
Browse files Browse the repository at this point in the history
  • Loading branch information
wiltsecarpenter committed Oct 16, 2023
1 parent 83de149 commit d8c36a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions bin/observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
const command = process.argv.splice(2, 1)[0];

switch (command) {
case "-v":
case "--version": {
import("../package.json").then(({version}: any) => console.log(version));
break;
}
case "build":
import("../src/build.js");
break;
Expand All @@ -13,6 +18,7 @@ switch (command) {
console.error(`Usage: observable <command>`);
console.error(` build\tgenerate a static site`);
console.error(` preview\trun the live preview server`);
console.error(` --version\tprint the version`);
process.exit(1);
break;
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node16"
"moduleResolution": "node16",
"resolveJsonModule": true
}
}

0 comments on commit d8c36a0

Please sign in to comment.