From 16a512cd34e8ff1d5a2f7405c41e1defe32275c8 Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Mon, 8 Feb 2021 16:57:56 -0800 Subject: [PATCH] upgrade to nxp3 2.0.8-preview --- package.json | 2 +- src/extension/commands/neoExpressCommands.ts | 12 ++++++------ src/extension/fileDetectors/checkpointDetector.ts | 2 +- src/extension/neoExpress/neoExpress.ts | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 934806b..77f874c 100644 --- a/package.json +++ b/package.json @@ -290,7 +290,7 @@ }, "scripts": { "bundle-nxp": "npm run bundle-nxp-download && npm run bundle-nxp-extract", - "bundle-nxp-download": "mkdirp deps/nxp && cleandir deps/nxp && nwget \"https://github.com/neo-project/neo-express/releases/download/1.2.85-insiders/Neo.Express3.1.2.85-insiders.nupkg\" -O deps/nxp/nxp.nupkg", + "bundle-nxp-download": "mkdirp deps/nxp && cleandir deps/nxp && nwget \"https://github.com/neo-project/neo-express/releases/download/2.0.9-preview/Neo.Express.2.0.9-preview.nupkg\" -O deps/nxp/nxp.nupkg", "bundle-nxp-extract": "cd deps/nxp && extract-zip nxp.nupkg", "compile": "npm run compile-ext && npm run compile-panel", "compile-ext": "webpack --config src/extension/webpack.config.js --mode development", diff --git a/src/extension/commands/neoExpressCommands.ts b/src/extension/commands/neoExpressCommands.ts index a707b2f..f0a7c6a 100644 --- a/src/extension/commands/neoExpressCommands.ts +++ b/src/extension/commands/neoExpressCommands.ts @@ -142,14 +142,11 @@ export default class NeoExpressCommands { try { await fs.promises.mkdir(checkpointsFolder); } catch {} - let filename = posixPath(checkpointsFolder, "checkpoint-1.nxp3-checkpoint"); + let filename = posixPath(checkpointsFolder, "checkpoint-1"); let i = 1; - while (fs.existsSync(filename)) { + while (fs.existsSync(`${filename}.neoxp-checkpoint`)) { i++; - filename = posixPath( - checkpointsFolder, - `checkpoint-${i}.nxp3-checkpoint` - ); + filename = posixPath(checkpointsFolder, `checkpoint-${i}`); } const output = await neoExpress.run( "checkpoint", @@ -241,6 +238,9 @@ export default class NeoExpressCommands { "Select a checkpoint to restore", ...checkpointDetector.checkpointFiles ); + if (!filename) { + return; + } const confirmed = await IoHelpers.yesNo( `Are you sure that you want to restore "${identifier.configPath}" to the checkpoint "${filename}"?` ); diff --git a/src/extension/fileDetectors/checkpointDetector.ts b/src/extension/fileDetectors/checkpointDetector.ts index ab143b4..2e5a296 100644 --- a/src/extension/fileDetectors/checkpointDetector.ts +++ b/src/extension/fileDetectors/checkpointDetector.ts @@ -1,6 +1,6 @@ import DetectorBase from "./detectorBase"; -const SEARCH_PATTERN = "**/*.nxp3-checkpoint"; +const SEARCH_PATTERN = "**/*.neoxp-checkpoint"; export default class CheckpointDetector extends DetectorBase { get checkpointFiles() { diff --git a/src/extension/neoExpress/neoExpress.ts b/src/extension/neoExpress/neoExpress.ts index 29193e1..bc93408 100644 --- a/src/extension/neoExpress/neoExpress.ts +++ b/src/extension/neoExpress/neoExpress.ts @@ -30,9 +30,9 @@ export default class NeoExpress { "deps", "nxp", "tools", - "netcoreapp3.1", + "net5.0", "any", - "nxp3.dll" + "neoxp.dll" ); this.dotnetPath = which.sync("dotnet", { nothrow: true }) || "dotnet"; this.runLock = false; @@ -66,7 +66,7 @@ export default class NeoExpress { if (duration > 1000) { Log.log( LOG_PREFIX, - `\`nxp3 ${command} ${options.join(" ")}\` took ${duration}ms` + `\`neoexp ${command} ${options.join(" ")}\` took ${duration}ms` ); } return result; @@ -122,14 +122,14 @@ export default class NeoExpress { ok = parseInt( childProcess.execFileSync(this.dotnetPath, ["--version"]).toString() - ) >= 3; + ) >= 5; } catch (e) { Log.error(LOG_PREFIX, "checkForDotNet error:", e.message); ok = false; } if (!ok) { const response = await vscode.window.showErrorMessage( - ".NET Core 3 or higher is required to use this functionality.", + ".NET 5 or higher is required to use this functionality.", "Dismiss", "More info" );