Skip to content

Commit

Permalink
fix: convert changeManifestVersion.js to TypeScript #253 (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robot-Inventor authored Oct 20, 2023
1 parent 6b1e5ba commit 0a701e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build": "npm run format && ts-node ./script/build.ts",
"package": "ts-node ./script/package.ts",
"version": "npm run build && npm run package && git add .",
"switchManifest": "node ./script/changeManifestVersion.js"
"switchManifest": "ts-node ./script/changeManifestVersion.ts"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -56,4 +56,4 @@
"@types/webextension-polyfill": "^0.10.4",
"knip": "^2.25.2"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const fs = require("fs");
import fs from "fs";

const packageJson = require("../package.json");
const manifestV2 = require("../manifest/v2.json");
const manifestV3 = require("../manifest/v3.json");
import packageJson from "../package.json";
import manifestV2 from "../manifest/v2.json";
import manifestV3 from "../manifest/v3.json";

const { version } = packageJson;
const arg = process.argv[2];

if (arg == 2) {
if (arg == "2") {
manifestV2.version = version;
const manifestText = JSON.stringify(manifestV2, null, 4);
fs.writeFileSync("./manifest.json", manifestText);
console.log(`Switched to manifest v${arg}.`);
} else if (arg == 3) {
} else if (arg == "3") {
manifestV3.version = version;
const manifestText = JSON.stringify(manifestV3, null, 4);
fs.writeFileSync("./manifest.json", manifestText);
Expand Down

0 comments on commit 0a701e4

Please sign in to comment.