Skip to content

Commit

Permalink
move cli to bin folder
Browse files Browse the repository at this point in the history
  • Loading branch information
dmstern committed Oct 9, 2018
1 parent 69de587 commit 059e4fb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
frog-*.log
logs

# Editor directories and files
.idea
Expand Down
14 changes: 10 additions & 4 deletions cli.js → bin/cli.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/usr/bin/env node

//==============================================================
const exec = require('child_process').exec;
const path = require('path');
const pm2Config = require('./pm2.config');
console.log('__dirname', __dirname);
const pm2Config = require('../pm2.config');
const port = pm2Config.serveUIStatic.env.PM2_SERVE_PORT;
const logFiles = {
ui: path.join(__dirname, pm2Config.runServer.cwd || '', pm2Config.runServer.log),
server: path.join(__dirname, pm2Config.serveUIStatic.cwd || '', pm2Config.serveUIStatic.log),
ui: path.join(__dirname, '..', pm2Config.runServer.cwd || '', pm2Config.runServer.log),
server: path.join(
__dirname,
'..',
pm2Config.serveUIStatic.cwd || '',
pm2Config.serveUIStatic.log,
),
};
const startCommand = 'run prod';
const programm = 'npmfrog';
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"pre-commit": "pretty-quick && git add ."
}
},
"bin": "./cli.js",
"dependencies": {
"axios": "^0.18.0",
"body-parser": "^1.18.3",
Expand Down Expand Up @@ -88,8 +87,7 @@
"ecosystem.config.js",
".sample.npmfrogrc.json",
"pm2.config.js",
"pm2.prod.config.js",
"cli.js"
"pm2.prod.config.js"
],
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions pm2.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ module.exports = {
name: 'frog-server',
script: 'index.js',
cwd: 'dist/server/',
log: '../../frog-server.log',
log: '../../logs/frog-server.log',
env_local,
},
serveUIStatic: {
name: 'frog-ui-static',
script: 'serve',
log: './frog-ui.log',
log: './logs/frog-ui.log',
log_date_format,
env: {
PM2_SERVE_PATH: 'dist/webui',
Expand Down
4 changes: 2 additions & 2 deletions server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"noImplicitAny": false,
"module": "commonjs",
"target": "es5",
"lib": ["es5", "es2015", "dom", "scripthost"],
"lib": ["es5", "es2015", "dom", "scripthost"]
},
"include": ["**/*.ts"],
"exclude": ["node_modules", "**/*.spec.ts"],
"exclude": ["node_modules", "**/*.spec.ts"]
}

0 comments on commit 059e4fb

Please sign in to comment.