From 59e5eef9b107eda4b72b968b9150c002850f08b7 Mon Sep 17 00:00:00 2001 From: Cyn Date: Wed, 5 Jan 2022 19:35:19 -0500 Subject: [PATCH] Update template for new extension link --- .eslintrc.js | 2 +- .gitignore | 1 - .vscode/extensions.json | 2 +- README.md | 2 +- package.json | 1 + src/watcher.ts | 6 +++--- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index c17e32b..5479108 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,7 +14,7 @@ module.exports = { }, }, plugins: ["@typescript-eslint"], - ignorePatterns: ['NetscriptDefinitions.d.ts'], + ignorePatterns: ['NetscriptDefinitions.d.ts', '*.js'], rules: { "accessor-pairs": [ "error", diff --git a/.gitignore b/.gitignore index 61f6ea9..6879e03 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ node_modules/ dist/ package-lock.json -OAuth.js NetscriptDefinitions.d.ts \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json index ae217cb..b3abc8e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,6 @@ "recommendations": [ "dbaeumer.vscode-eslint", "Gruntfuggly.auto-snippet", - "hexnaught.vscode-bitburner-connector" + "bitburner.bitburner-vscode-integration" ] } \ No newline at end of file diff --git a/README.md b/README.md index 705f785..39c0280 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## Extension Recommendations -[vscode-bitburner-connector](https://github.com/hexnaught/vscode-bitburner-connector) ([vscode extension marketplace](https://marketplace.visualstudio.com/items?itemName=hexnaught.vscode-bitburner-connector)) to upload your files into the game +[vscode-bitburner-connector](https://github.com/bitburner-official/bitburner-vscode) ([vscode extension marketplace](https://marketplace.visualstudio.com/items?itemName=bitburner.bitburner-vscode-integration)) to upload your files into the game [vscode-eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) to use live linting in editor diff --git a/package.json b/package.json index b7ade2e..e52426f 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ }, "homepage": "https://github.com/SlyCedix/bitburner-typescript-template#readme", "devDependencies": { + "@types/lodash": "^4.14.178", "@types/node": "^16.4.3", "@typescript-eslint/eslint-plugin": "^4.28.4", "@typescript-eslint/parser": "^4.28.4", diff --git a/src/watcher.ts b/src/watcher.ts index 2dd0772..33a80ce 100644 --- a/src/watcher.ts +++ b/src/watcher.ts @@ -17,16 +17,16 @@ export async function main(ns: NS): Promise { const hash = getHash(contents) if (hash != hashes[file]) { - ns.tprint(`INFO: Detected change in ${file}`) + ns.tprintf(`INFO: Detected change in ${file}`) const processes = ns.ps().filter((p: ProcessInfo) => { return p.filename == file }) for (const process of processes) { - ns.tprint(`INFO: Restarting ${process.filename} ${process.args} -t ${process.threads}`) + ns.tprintf(`INFO: Restarting ${process.filename} ${process.args} -t ${process.threads}`) if (process.filename != ns.getScriptName()) { - ns.kill(process.pid, ns.getHostname()) + ns.kill(process.pid) ns.run(process.filename, process.threads, ...process.args) } else { ns.spawn(process.filename, process.threads, ...process.args)