-
Notifications
You must be signed in to change notification settings - Fork 109
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
14 changed files
with
173 additions
and
141 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
BasedOnStyle: Google | ||
IndentWidth: 4 | ||
ColumnLimit: 125 | ||
DerivePointerAlignment: false | ||
PointerAlignment: Right |
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,22 @@ | ||
Checks: "-*, | ||
clang-diagnostic-*, | ||
clang-analyzer-*, | ||
cppcoreguidelines-init-variables, | ||
google-runtime-int, | ||
google-readability-avoid-underscore-in-googletest-name, | ||
misc-*, | ||
performance-*, | ||
portability-*, | ||
readability-*, | ||
-misc-no-recursion, | ||
-readability-function-cognitive-complexity" | ||
WarningsAsErrors: "*" | ||
CheckOptions: | ||
- key: readability-identifier-length.MinimumVariableNameLength | ||
value: 2 | ||
- key: readability-identifier-length.MinimumParameterNameLength | ||
value: 2 | ||
- key: readability-identifier-length.MinimumLoopCounterNameLength | ||
value: 1 | ||
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues | ||
value: true |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = { | ||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
globals: { | ||
window: 'readonly', | ||
document: 'readonly', | ||
process: 'readonly', | ||
require: 'readonly', | ||
}, | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
}, | ||
}, | ||
ignores: ['dist/*', 'node_modules/*'], | ||
plugins: { | ||
'unused-imports': require('eslint-plugin-unused-imports'), | ||
'@typescript-eslint': require('@typescript-eslint/eslint-plugin'), | ||
'eslint-plugin-tsdoc': require('eslint-plugin-tsdoc'), | ||
}, | ||
rules: { | ||
curly: 'warn', | ||
'prefer-const': 'warn', | ||
'no-else-return': 'warn', | ||
complexity: ['warn', 1000], | ||
'no-unneeded-ternary': 'warn', | ||
'no-alert': 'warn', | ||
'no-empty': 'warn', | ||
'no-useless-catch': 'error', | ||
'require-await': 'warn', | ||
'no-continue': 'warn', | ||
'no-console': 'warn', | ||
'unused-imports/no-unused-imports': 'warn', | ||
'no-magic-numbers': 'off', | ||
}, | ||
} |
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,16 +1,21 @@ | ||
import Zemu from '@zondax/zemu' | ||
const Zemu = require('@zondax/zemu') | ||
|
||
const catchExit = async () => { | ||
process.on('SIGINT', () => { | ||
Zemu.stopAllEmuContainers(function () { | ||
process.exit() | ||
}) | ||
/** | ||
* Sets up a handler to stop all emulator containers when a SIGINT is received. | ||
*/ | ||
const catchExit = () => { | ||
process.on('SIGINT', async () => { | ||
await Zemu.default.stopAllEmuContainers() | ||
process.exit() | ||
}) | ||
} | ||
|
||
/** | ||
* Initializes the emulator environment by setting up exit handlers, | ||
* pulling the latest emulator image, and stopping any running emulator containers. | ||
*/ | ||
module.exports = async () => { | ||
await catchExit() | ||
await Zemu.checkAndPullImage() | ||
await Zemu.stopAllEmuContainers() | ||
catchExit() | ||
await Zemu.default.checkAndPullImage() | ||
await Zemu.default.stopAllEmuContainers() | ||
} | ||
// |
Oops, something went wrong.