refactor: adjust code to updated dependencies

This commit is contained in:
Karl-Philipp Wulfert
2019-11-25 14:23:36 +01:00
parent 90513868c5
commit c9c8a64c0e
2 changed files with 8 additions and 2 deletions

View File

@@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License along with * You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import * as commander from 'commander'; import {Command} from 'commander';
import {existsSync, readFileSync, writeFileSync} from 'fs'; import {existsSync, readFileSync, writeFileSync} from 'fs';
import {resolve} from 'path'; import {resolve} from 'path';
import {cwd} from 'process'; import {cwd} from 'process';
@@ -35,12 +35,17 @@ import {
// current working directory // current working directory
const currentWorkingDirectory = cwd(); const currentWorkingDirectory = cwd();
// instantiate new commander
const commander = new Command('openstapps-configuration');
// configure commander // configure commander
commander commander
.version(JSON.parse( .version(JSON.parse(
readFileSync(resolve(__dirname, '..', 'package.json')) readFileSync(resolve(__dirname, '..', 'package.json'))
.toString(), .toString(),
).version) ).version);
commander
.option('-p, --path <path>', `Path of project to add files to (${currentWorkingDirectory})`, currentWorkingDirectory) .option('-p, --path <path>', `Path of project to add files to (${currentWorkingDirectory})`, currentWorkingDirectory)
.option('-r, --replace', 'Whether to replace existing files or not', false) .option('-r, --replace', 'Whether to replace existing files or not', false)
.parse(process.argv); .parse(process.argv);

View File

@@ -3,6 +3,7 @@
"alwaysStrict": true, "alwaysStrict": true,
"charset": "utf8", "charset": "utf8",
"declaration": true, "declaration": true,
"esModuleInterop": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"inlineSourceMap": true, "inlineSourceMap": true,