Skip to content

Commit 3dbc893

Browse files
committed
Refactor bin out to run.ts
1 parent 2731977 commit 3dbc893

File tree

5 files changed

+27
-24
lines changed

5 files changed

+27
-24
lines changed

config/build.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const CONFIG = require(path.join(MONGOSH, 'package.json'));
1818
/**
1919
* The input for the build.
2020
*/
21-
const INPUT = path.join(MONGOSH, 'bin', 'mongosh.js');
21+
const INPUT = path.join(MONGOSH, 'lib', 'run.js');
2222

2323
/**
2424
* The input for the exec.

packages/build/src/release.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ const release = async(config: Config) => {
3838
const artifact = await zip(executable, config.outputDir, platform, config.version);
3939

4040
// Sign and notarize the executable and artifact for MacOs.
41-
if (platform === Platform.MacOs) {
42-
await publishMacOs(executable, artifact, platform, config);
43-
}
41+
//if (platform === Platform.MacOs) {
42+
// await publishMacOs(executable, artifact, platform, config);
43+
//}
4444

4545
// Create & sign the .rpm (only on linux)
4646
// Create & sign the .msi (only on win)

packages/cli-repl/bin/mongosh.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,2 @@
1-
const { CliRepl, parseCliArgs, mapCliToDriver, generateUri, USAGE } = require('../lib');
2-
3-
try {
4-
const options = parseCliArgs(process.argv);
5-
const { version } = require('../package.json');
6-
7-
if (options.help) {
8-
console.log(USAGE);
9-
} else if (options.version) {
10-
console.log(version);
11-
} else {
12-
process.title = 'mongosh';
13-
const driverOptions = mapCliToDriver(options);
14-
const driverUri = generateUri(options);
15-
const appname = `${process.title} ${version}`;
16-
new CliRepl(driverUri, { appname, ...driverOptions }, options);
17-
}
18-
} catch (e) {
19-
console.log(e.message);
20-
}
1+
#!/usr/bin/env node
2+
require('../lib/run');

packages/cli-repl/src/run.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { CliRepl, parseCliArgs, mapCliToDriver, generateUri, USAGE } from './index';
2+
3+
try {
4+
const options = parseCliArgs(process.argv);
5+
const { version } = require('../package.json');
6+
7+
if (options.help) {
8+
console.log(USAGE);
9+
} else if (options.version) {
10+
console.log(version);
11+
} else {
12+
process.title = 'mongosh';
13+
const driverOptions = mapCliToDriver(options);
14+
const driverUri = generateUri(options);
15+
const appname = `${process.title} ${version}`;
16+
new CliRepl(driverUri, { appname, ...driverOptions }, options);
17+
}
18+
} catch (e) {
19+
console.log(e.message);
20+
}

packages/service-provider-server/src/node/node-options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import NodeFleOptions from './node-fle-options';
66
* partial list of things that need to be mapped.
77
*/
88
export default interface NodeOptions {
9+
appname?: string;
910
auth?: NodeAuthOptions;
1011
authSource?: string;
1112
authMechanism?: string;

0 commit comments

Comments
 (0)