Skip to content

Commit

Permalink
chore: fix imports (#15068)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Apr 12, 2022
1 parent fb729cf commit 199652a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 58 deletions.
2 changes: 1 addition & 1 deletion tools/dispatch-release.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import got from 'got';
import shell from 'shelljs';
import { options } from './utils.mjs';
import { options } from './utils/options.mjs';

const version = options.release;
const tag = options.tag || 'latest';
Expand Down
2 changes: 1 addition & 1 deletion tools/docs/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import table from 'markdown-table';
import { getOptions } from '../../lib/config/options';
import { getCliName } from '../../lib/workers/global/config/parse/cli';
import { getEnvName } from '../../lib/workers/global/config/parse/env';
import { readFile, updateFile } from '../utils/index';
import { readFile, updateFile } from '../utils';

const options = getOptions();

Expand Down
22 changes: 1 addition & 21 deletions tools/release.mjs
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
import shell from 'shelljs';
import { options } from './utils.mjs';
import { options } from './utils/options.mjs';

const version = options.release;
// const sha = program.sha;

// let err = false;

shell.echo(`Publishing version: ${version}`);

// shell.echo('Publishing npm package ...');
// if (
// !exec(`npm --no-git-tag-version version ${version}`) ||
// !exec(`npm publish`)
// ) {
// err = true;
// }

// shell.echo('Publishing docker images ...');
// if (!exec(`./.github/workflows/release-docker.sh ${version} ${sha}`)) {
// err = true;
// }

// eslint-disable-next-line promise/valid-params,@typescript-eslint/no-floating-promises
import('./dispatch-release.mjs').catch();

// if (err) {
// shell.exit(2);
// }
35 changes: 0 additions & 35 deletions tools/utils.mjs

This file was deleted.

15 changes: 15 additions & 0 deletions tools/utils/options.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Command } from 'commander';

const program = new Command();
program
.version('0.0.1')
.requiredOption('-r, --release <type>', 'Version to use')
.option('-s, --sha <type>', 'Git sha to use')
.option('-t, --tag <type>', 'Npm dist-tag to publish to')
.option('-d, --dry-run');

program.parse(process.argv);

export const options = program.opts();

export { program };

0 comments on commit 199652a

Please sign in to comment.