Skip to content

Commit

Permalink
refactor(api): remove testnet path (#436)
Browse files Browse the repository at this point in the history
* Remove testnet folder

* Empty commit
  • Loading branch information
sebastijankuzner authored Feb 16, 2024
1 parent affcb99 commit 06cd5f1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 32 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"/distribution"
],
"scripts": {
"api:testnet": "cross-env-shell CORE_PATH_CONFIG=./bin/config/testnet pnpm run mainsail-api api:run",
"api:testnet": "cross-env-shell CORE_PATH_CONFIG=./bin/config pnpm run mainsail-api api:run",
"build": "pnpm run clean && tsc",
"build:watch": "pnpm run clean && tsc -w",
"clean": "del distribution",
Expand Down
33 changes: 2 additions & 31 deletions packages/api/source/commands/config-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,14 @@ export class Command extends Commands.Command {
}

public async execute(): Promise<void> {
if (this.hasFlag("network")) {
return this.#performPublishment(this.getFlags());
}

const response = await this.components.prompt([
// {
// choices: Object.keys(Networks).map((network) => ({ title: network, value: network })),
// message: "Please select which network you want to operate on",
// name: "network",
// type: "select",
// },
{
message: "Can you confirm?",
name: "confirm",
type: "confirm",
},
]);

if (!response.network) {
this.components.fatal("You'll need to select the network to continue.");
}

if (!response.confirm) {
this.components.fatal("You'll need to confirm the network to continue.");
}

await this.#performPublishment({ ...response, ...this.getFlags() });
await this.#performPublishment(this.getFlags());
}

async #performPublishment(flags: Contracts.AnyObject): Promise<void> {
this.app.rebind(Identifiers.ApplicationPaths).toConstantValue(this.environment.getPaths());

const configDestination = this.app.getCorePath("config");
const configSource = resolve(
__dirname,
`../../bin/config/${flags.network}/${this.app.get(Identifiers.Application.Name)}`,
);
const configSource = resolve(__dirname, `../../bin/config/${this.app.get(Identifiers.Application.Name)}`);

await this.components.taskList([
{
Expand Down

0 comments on commit 06cd5f1

Please sign in to comment.