added support for current branch, and some cleanup
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { GluegunMenuToolbox } from '@lenne.tech/gluegun-menu';
|
||||
import chalk = require('chalk');
|
||||
import { system } from 'gluegun';
|
||||
import { defaultMenuSettings } from '../../../globals';
|
||||
import { defaultMenuSettings, getSettings } from '../../../globals';
|
||||
const { Confirm, Input } = require('enquirer');
|
||||
|
||||
const checkCLIProgram = async (toolbox: GluegunMenuToolbox, cmd: string) => {
|
||||
@@ -33,6 +33,8 @@ module.exports = {
|
||||
|
||||
`));
|
||||
|
||||
let config = await getSettings(toolbox);
|
||||
|
||||
// Check if brew is installed
|
||||
// if (await checkCLIProgram(toolbox, 'brew')) {
|
||||
// print.info(`\nDetected ${chalk.green('brew')}`);
|
||||
@@ -100,17 +102,21 @@ module.exports = {
|
||||
|
||||
await system.run('touch ~/.pwcli_settings');
|
||||
print.info(`Created configuration file ${chalk.yellow(`~/.pwcli_settings`)}`);
|
||||
const config = {
|
||||
gh_token: '',
|
||||
photowall_repo: '',
|
||||
};
|
||||
if (!config) {
|
||||
config = {
|
||||
gh_token: '',
|
||||
photowall_repo: '',
|
||||
};
|
||||
}
|
||||
|
||||
config.gh_token = await (new Input({
|
||||
message: `A github accesstoken is required with ${chalk.yellow('Full control of private repositories')}, please insert the key >`
|
||||
message: `A github accesstoken is required with ${chalk.yellow('Full control of private repositories')}, please insert the key >`,
|
||||
initial: config.gh_token,
|
||||
})).run();
|
||||
|
||||
config.photowall_repo = await (new Input({
|
||||
message: `If you want to be able to push active branch in your photowall repository, please insert the absolute path to the project >`
|
||||
message: `If you want to be able to use current branch in your photowall repository\nwhen creating or updating testservers, please insert\nthe absolute path to the project or leave blank >`,
|
||||
initial: config.photowall_repo,
|
||||
})).run();
|
||||
|
||||
print.info(`
|
||||
|
||||
Reference in New Issue
Block a user