-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #698 from LedgerHQ/support/clean-bash-scripts
- Loading branch information
Showing
53 changed files
with
2,020 additions
and
3,522 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env zx | ||
import "zx/globals"; | ||
|
||
const src = path.join(__dirname, "..", "src"); | ||
const subfolder = "commands"; | ||
const p = path.join(src, subfolder); | ||
async function gen() { | ||
let imports = ``; | ||
let exprts = `export default {`; | ||
for (const file of await fs.promises.readdir(p)) { | ||
const clean = file.replace(".ts", ""); | ||
imports += `import ${clean} from "./${subfolder}/${clean}"; | ||
`; | ||
exprts += ` | ||
${clean},`; | ||
} | ||
|
||
exprts = exprts.substring(0, exprts.length - 1); | ||
exprts += ` | ||
}; | ||
`; | ||
|
||
const str = `${imports} | ||
${exprts}`; | ||
|
||
return str; | ||
} | ||
|
||
const str = await gen(); | ||
await fs.promises.writeFile(path.join(src, "commands-index.ts"), str, "utf8"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,5 +97,5 @@ export default { | |
testGetTrustedInputFromTxHash, | ||
user, | ||
version, | ||
walletconnect, | ||
walletconnect | ||
}; |
This file was deleted.
Oops, something went wrong.
57 changes: 0 additions & 57 deletions
57
apps/ledger-live-desktop/scripts/create-release-shasums.sh
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
62 changes: 62 additions & 0 deletions
62
apps/ledger-live-desktop/scripts/sync-families-dispatch.mjs
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,62 @@ | ||
#!/usr/bin/env zx | ||
import "zx/globals"; | ||
import rimraf from "rimraf"; | ||
|
||
const basePath = path.join(__dirname, ".."); | ||
const rendererPath = path.join(basePath, "src", "renderer"); | ||
const generatedPath = path.join(rendererPath, "generated"); | ||
|
||
await rimraf(generatedPath, async e => { | ||
if (!!e) return echo(chalk.red(e)); | ||
await fs.promises.mkdir(generatedPath); | ||
}); | ||
|
||
const families = await fs.readdir(path.join(rendererPath, "families")); | ||
const targets = [ | ||
"operationDetails.jsx", | ||
"operationDetails.js", | ||
"accountActions.jsx", | ||
"TransactionConfirmFields.jsx", | ||
"AccountBodyHeader.js", | ||
"AccountSubHeader.jsx", | ||
"SendAmountFields.jsx", | ||
"SendRecipientFields.jsx", | ||
"SendWarning.js", | ||
"ReceiveWarning.jsx", | ||
"AccountBalanceSummaryFooter.jsx", | ||
"TokenList.jsx", | ||
"AccountHeaderManageActions.js", | ||
"StepReceiveFunds.jsx", | ||
"NoAssociatedAccounts.jsx", | ||
]; | ||
|
||
async function genTarget(target) { | ||
let imports = `// @flow`; | ||
let exprts = `export default {`; | ||
const outpath = path.join(generatedPath, target); | ||
|
||
for (const family of families) { | ||
try { | ||
await fs.promises.access( | ||
path.join(rendererPath, "families", family, target), | ||
fs.constants.R_OK, | ||
); | ||
imports += ` | ||
import ${family} from "../families/${family}/${target}";`; | ||
exprts += ` | ||
${family},`; | ||
} catch (error) {} | ||
} | ||
|
||
exprts += ` | ||
}; | ||
`; | ||
|
||
const str = `${imports} | ||
${exprts}`; | ||
|
||
await fs.promises.writeFile(outpath, str, "utf8"); | ||
} | ||
|
||
targets.map(genTarget); |
69 changes: 0 additions & 69 deletions
69
apps/ledger-live-desktop/scripts/sync-families-dispatch.sh
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
Oops, something went wrong.