@sparkbox/carbon-cli
Advanced tools
Comparing version 0.5.2 to 0.5.3-1e375f7.0
@@ -12,9 +12,5 @@ "use strict"; | ||
const inquirer_autocomplete_prompt_1 = __importDefault(require("inquirer-autocomplete-prompt")); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const fuzzy_1 = __importDefault(require("fuzzy")); | ||
const util_1 = require("../util"); | ||
inquirer_1.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default); | ||
const displayAsPath = (newProjectDir) => { | ||
return `${chalk_1.default.gray(process.cwd() + '/')}${chalk_1.default.cyan(util_1.kebabCase(newProjectDir))}`; | ||
}; | ||
async function buildOptions(repoNames) { | ||
@@ -26,7 +22,3 @@ const opts = await inquirer_1.prompt([ | ||
message: 'search for a repo to replicate', | ||
async source(answers, input) { | ||
input = input || ''; | ||
const fuzzyResult = fuzzy_1.default.filter(input, repoNames); | ||
return fuzzyResult.map(el => el.original); | ||
}, | ||
source: fuzzyMatch(repoNames), | ||
}, | ||
@@ -44,3 +36,3 @@ { | ||
filter: util_1.kebabCase, | ||
transformer: displayAsPath, | ||
transformer: util_1.displayAsPath, | ||
}, | ||
@@ -77,2 +69,10 @@ { | ||
exports.confirmOptions = confirmOptions; | ||
function fuzzyMatch(repoNames) { | ||
return async (answers, input) => { | ||
input = input || ''; | ||
const fuzzyResult = fuzzy_1.default.filter(input, repoNames); | ||
return fuzzyResult.map(el => el.original); | ||
}; | ||
} | ||
exports.fuzzyMatch = fuzzyMatch; | ||
//# sourceMappingURL=project-options.js.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path_1 = __importDefault(require("path")); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
function kebabCase(text) { | ||
@@ -24,2 +29,6 @@ return text.toLowerCase().replace(/\s/g, '-'); | ||
exports.password = password; | ||
function displayAsPath(newProjectDir) { | ||
return `${chalk_1.default.gray(process.cwd() + path_1.default.sep)}${chalk_1.default.cyan(kebabCase(newProjectDir))}`; | ||
} | ||
exports.displayAsPath = displayAsPath; | ||
function tarUrl(repoName, branch = 'master') { | ||
@@ -26,0 +35,0 @@ return `https://api.github.com/repos/sparkbox/${repoName}/tarball/${branch}`; |
{ | ||
"name": "@sparkbox/carbon-cli", | ||
"version": "0.5.2", | ||
"version": "0.5.3-1e375f7.0", | ||
"description": "Project Setup Automation", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
193226
417