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
* 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 {resolve} from 'path';
import {cwd} from 'process';
@@ -35,12 +35,17 @@ import {
// current working directory
const currentWorkingDirectory = cwd();
// instantiate new commander
const commander = new Command('openstapps-configuration');
// configure commander
commander
.version(JSON.parse(
readFileSync(resolve(__dirname, '..', 'package.json'))
.toString(),
).version)
).version);
commander
.option('-p, --path <path>', `Path of project to add files to (${currentWorkingDirectory})`, currentWorkingDirectory)
.option('-r, --replace', 'Whether to replace existing files or not', false)
.parse(process.argv);