-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug for wallets with spaces in the name
- Loading branch information
Rodrigo Sanchez
committed
May 18, 2023
1 parent
1007b5c
commit 99e174e
Showing
10 changed files
with
202 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const manifest_v2 = require('../versions/manifest_v2.json'); | ||
const manifest_v3 = require('../static/manifest.json'); | ||
const TOML = require('@iarna/toml'); | ||
const fs = require('fs'); | ||
|
||
const cargo = TOML.parse(fs.readFileSync('../Cargo.toml', 'utf-8')); | ||
|
||
const parseVersion = (version) => { | ||
const [major, minor, patch] = version.split('.'); | ||
return { | ||
major: parseInt(major), | ||
minor: parseInt(minor), | ||
patch: parseInt(patch), | ||
}; | ||
}; | ||
|
||
const upgradeMajorVersion = (version) => { | ||
const { major } = parseVersion(version); | ||
return `${major + 1}.0.0`; | ||
}; | ||
|
||
const upgradeMinorVersion = (version) => { | ||
const { major, minor } = parseVersion(version); | ||
return `${major}.${minor + 1}.0`; | ||
}; | ||
|
||
const upgradePatchVersion = (version) => { | ||
const { major, minor, patch } = parseVersion(version); | ||
return `${major}.${minor}.${patch + 1}`; | ||
}; | ||
|
||
const upgradeVersion = (version) => { | ||
const args = process.argv.slice(2); | ||
if (args.length === 0) { | ||
throw new Error('Please specify the type of version upgrade'); | ||
} | ||
const type = args[0]; | ||
switch (type) { | ||
case 'major': | ||
return upgradeMajorVersion(version); | ||
case 'minor': | ||
return upgradeMinorVersion(version); | ||
case 'patch': | ||
return upgradePatchVersion(version); | ||
default: | ||
return upgradePatchVersion(version); | ||
} | ||
}; | ||
|
||
manifest_v2.version = upgradeVersion(manifest_v2.version); | ||
manifest_v3.version = upgradeVersion(manifest_v3.version); | ||
cargo.package.version = upgradeVersion(cargo.package.version); | ||
|
||
fs.writeFileSync('../versions/manifest_v2.json', JSON.stringify(manifest_v2, null, 2)); | ||
fs.writeFileSync('../static/manifest.json', JSON.stringify(manifest_v3, null, 2)); | ||
fs.writeFileSync('../Cargo.toml', TOML.stringify(cargo)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "NodeGuard Companion", | ||
"description": "Import or generate your Bitcoin mnemonics, export your xpubs and sign your PSBTs with a few clicks. Your private keys never leave your browser, we don't store any data in our servers.", | ||
"version": "0.2.2", | ||
"action": { | ||
"default_popup": "popup.html" | ||
}, | ||
"content_security_policy": { | ||
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'" | ||
}, | ||
"content_scripts": [ | ||
{ | ||
"matches": [ | ||
"http://localhost:38080/*", | ||
"https://nodeguard-staging.elenpay.tech/*", | ||
"https://nodeguard.elenpay.tech/*" | ||
], | ||
"js": [ | ||
"browser-polyfill.min.js", | ||
"content.js" | ||
] | ||
} | ||
], | ||
"permissions": [ | ||
"activeTab", | ||
"tabs", | ||
"storage" | ||
], | ||
"web_accessible_resources": [ | ||
{ | ||
"resources": [ | ||
"index.js" | ||
], | ||
"matches": [ | ||
"http://localhost:38080/*", | ||
"https://nodeguard-staging.elenpay.tech/*", | ||
"https://nodeguard.elenpay.tech/*" | ||
] | ||
} | ||
], | ||
"externally_connectable": { | ||
"matches": [ | ||
"http://localhost:38080/*", | ||
"https://nodeguard-staging.elenpay.tech/*", | ||
"https://nodeguard.elenpay.tech/*" | ||
] | ||
}, | ||
"icons": { | ||
"16": "icon16.png", | ||
"32": "icon32.png", | ||
"48": "icon48.png", | ||
"128": "icon128.png" | ||
}, | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "[email protected]", | ||
"strict_min_version": "109.0" | ||
} | ||
"manifest_version": 3, | ||
"name": "NodeGuard Companion", | ||
"description": "Import or generate your Bitcoin mnemonics, export your xpubs and sign your PSBTs with a few clicks. Your private keys never leave your browser, we don't store any data in our servers.", | ||
"version": "0.2.3", | ||
"action": { | ||
"default_popup": "popup.html" | ||
}, | ||
"content_security_policy": { | ||
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'" | ||
}, | ||
"content_scripts": [ | ||
{ | ||
"matches": [ | ||
"http://localhost:38080/*", | ||
"https://nodeguard-staging.elenpay.tech/*", | ||
"https://nodeguard.elenpay.tech/*" | ||
], | ||
"js": [ | ||
"browser-polyfill.min.js", | ||
"content.js" | ||
] | ||
} | ||
], | ||
"permissions": [ | ||
"activeTab", | ||
"tabs", | ||
"storage" | ||
], | ||
"web_accessible_resources": [ | ||
{ | ||
"resources": [ | ||
"index.js" | ||
], | ||
"matches": [ | ||
"http://localhost:38080/*", | ||
"https://nodeguard-staging.elenpay.tech/*", | ||
"https://nodeguard.elenpay.tech/*" | ||
] | ||
} | ||
], | ||
"externally_connectable": { | ||
"matches": [ | ||
"http://localhost:38080/*", | ||
"https://nodeguard-staging.elenpay.tech/*", | ||
"https://nodeguard.elenpay.tech/*" | ||
] | ||
}, | ||
"icons": { | ||
"16": "icon16.png", | ||
"32": "icon32.png", | ||
"48": "icon48.png", | ||
"128": "icon128.png" | ||
}, | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "[email protected]", | ||
"strict_min_version": "109.0" | ||
} | ||
} | ||
} |
Oops, something went wrong.