-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: all in one setup scaffold (#51)
- Loading branch information
1 parent
2913e73
commit 15228f1
Showing
29 changed files
with
1,046 additions
and
84 deletions.
There are no files selected for viewing
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
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 @@ | ||
import { Option } from "commander"; | ||
|
||
import { getConfig } from "./config"; | ||
import { getConfigModules } from "./modules"; | ||
import { track } from "../../utils/analytics"; | ||
import Logger from "../../utils/logger"; | ||
|
||
import { local } from "."; | ||
|
||
const allOption = new Option("--all", "Node type to use"); | ||
type LocalStopOptions = { | ||
all?: true; | ||
}; | ||
|
||
export const handler = async (options: LocalStopOptions) => { | ||
try { | ||
Logger.debug(`Local stop options: ${JSON.stringify(options, null, 2)}`); | ||
|
||
const config = getConfig(); | ||
Logger.debug(`Local config: ${JSON.stringify(config, null, 2)}`); | ||
|
||
const modules = getConfigModules(config); | ||
Logger.info(`Cleaning: ${modules.map((m) => m.name).join(", ")}...`); | ||
await Promise.all(modules.map((m) => m.clean())); | ||
} catch (error) { | ||
Logger.error("There was an error while stopping the testing environment:"); | ||
Logger.error(error); | ||
track("error", { error }); | ||
} | ||
}; | ||
|
||
local | ||
.command("clean") | ||
.description("Stops the local zkSync environment and modules") | ||
.addOption(allOption) | ||
.action(handler); |
Oops, something went wrong.