Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
fix(commands): passed uri option to loadInitialData command
Browse files Browse the repository at this point in the history
  • Loading branch information
batamar committed Jun 17, 2020
1 parent a740750 commit d2296e0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test": "node --expose-gc --max_old_space_size=4000 ./node_modules/.bin/jest --runInBand --forceExit --silent --logHeapUsage && ts-node ./src/commands/aftertest.ts",
"generateVersion": "ts-node ./src/commands/generateVersion.ts",
"loadInitialData": "ts-node ./src/commands/loadInitialData.ts",
"loadPermission": "mongorestore --db erxes ./src/permissionData",
"loadPermission": "ts-node ./src/commands/loadPermissionData.ts",
"initProject": "ts-node ./src/commands/initProject.ts",
"createGooglePubsubTopics": "ts-node ./src/commands/createGooglePubsubTopics.ts",
"customCommand": "ts-node ./src/commands/customCommand.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/loadInitialData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Users } from '../db/models';
const main = async () => {
const MONGO_URL = getEnv({ name: 'MONGO_URL' });

const result = await shelljs.exec(`mongorestore --db erxes ./src/initialData`, { silent: true });
const result = await shelljs.exec(`mongorestore --uri ${MONGO_URL} --db erxes ./src/initialData`, { silent: true });
const output = result.stderr + result.stdout;

console.log(output);
Expand Down
17 changes: 17 additions & 0 deletions src/commands/loadPermissionData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as shelljs from 'shelljs';
import { getEnv } from '../data/utils';

const main = async () => {
const MONGO_URL = getEnv({ name: 'MONGO_URL' });

const result = await shelljs.exec(`mongorestore --uri ${MONGO_URL} --db erxes ./src/permissionData`, {
silent: true,
});
const output = result.stderr + result.stdout;

console.log(output);

process.exit();
};

main();

0 comments on commit d2296e0

Please sign in to comment.