forked from Anfauglith/core-control
-
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.
- Loading branch information
Showing
10 changed files
with
106 additions
and
77 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
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,42 @@ | ||
const fs = require('fs'); | ||
|
||
const appjsPath = process.argv[2]; | ||
if(!appjsPath) { | ||
console.error('ERROR: the Hydra installer script must have an argument passed: the path of the app.js file.'); | ||
process.exit(1); | ||
} | ||
|
||
if(!fs.existsSync(appjsPath)) { | ||
console.error(`ERROR: file does not exist at ${appjsPath}`); | ||
process.exit(1); | ||
} | ||
|
||
console.log(`Updating ${appjsPath}...`); | ||
|
||
let appjs = fs.readFileSync(appjsPath).toString(); | ||
if(appjs.indexOf('@internet-of-people/hydra-plugin')>-1) { | ||
console.log('Plugins already contains Morpheus plugin.'); | ||
process.exit(0); | ||
} | ||
|
||
var replaceTarget, replaceTo; | ||
|
||
if(appjs.indexOf('@internet-of-people/morpheus-hydra-plugin')>-1) { // upgrading from 2.6.31+p2 | ||
replaceTarget = '@internet-of-people/morpheus-hydra-plugin'; | ||
replaceTo = '@internet-of-people/hydra-plugin'; | ||
} | ||
else { | ||
replaceTarget = '"@arkecosystem/core-magistrate-transactions"'; | ||
replaceTo = '"@arkecosystem/core-magistrate-transactions", "@internet-of-people/hydra-plugin"'; | ||
} | ||
|
||
var regexp = new RegExp(replaceTarget, 'g'); | ||
|
||
appjs = appjs.replace( | ||
regexp, | ||
replaceTo | ||
); | ||
|
||
fs.writeFileSync(appjsPath, appjs); | ||
|
||
console.log('Appjs file has been updated.'); |
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,37 @@ | ||
const fs = require('fs'); | ||
|
||
const pluginsPath = process.argv[2]; | ||
if(!pluginsPath) { | ||
console.error('ERROR: the Hydra installer script must have an argument passed: the path of the plugins.js file.'); | ||
process.exit(1); | ||
} | ||
|
||
if(!fs.existsSync(pluginsPath)) { | ||
console.error(`ERROR: file does not exist at ${pluginsPath}`); | ||
process.exit(1); | ||
} | ||
|
||
console.log(`Updating ${pluginsPath}...`); | ||
|
||
let plugins = fs.readFileSync(pluginsPath).toString(); | ||
if(plugins.indexOf('@internet-of-people/hydra-plugin')>-1) { | ||
console.log('Plugins already contains the Hydra plugin.'); | ||
process.exit(0); | ||
} | ||
|
||
var replaceTarget, replaceTo; | ||
|
||
if(plugins.indexOf('@internet-of-people/morpheus-hydra-plugin')>-1) { // upgrading from 2.6.31+p2 | ||
replaceTarget = '@internet-of-people/morpheus-hydra-plugin'; | ||
replaceTo = '@internet-of-people/hydra-plugin'; | ||
} | ||
else { | ||
replaceTarget = '"@arkecosystem/core-transaction-pool"'; | ||
replaceTo = '"@internet-of-people/hydra-plugin": {},\n "@arkecosystem/core-transaction-pool"'; | ||
} | ||
|
||
plugins = plugins.replace(replaceTarget, replaceTo); | ||
|
||
fs.writeFileSync(pluginsPath, plugins); | ||
|
||
console.log('Plugins file has been updated.'); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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