Skip to content

Commit

Permalink
[BUGFIX] fix empty cache when user inside typo3conf/ext folder
Browse files Browse the repository at this point in the history
  • Loading branch information
dmh committed May 31, 2017
1 parent d0f2ccf commit 25b407a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function generateSubtheme () {
.then(() => prompt.isOk(cache, `Continue?`))
.then(check.folder)

.then(prompt.subthemeQuestions)
.then(prompt.siteName)
.then(() => prompt.isOk(cache, text.subtheme.isAutoDirName(cache), prompt.dirName))
.then(cmd.mkdir)
Expand Down Expand Up @@ -102,8 +101,9 @@ if (_.size(argv) !== 1 || argv._.length) {
// t3kit -s, --subtheme
} else if (argv.s || argv.subtheme) {
cache.whatToDo = 'subtheme'
console.log(chalk.red(text.notReady))
process.exit(1)
generateSubtheme()
// console.log(chalk.red(text.notReady))
// process.exit(1)
} else {
help.allHelp()
}
Expand Down
2 changes: 2 additions & 0 deletions lib/check/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ check.folder = function folder (cache) {
// Check folder
if (!helpers.pwd().endsWith('typo3conf/ext')) {
return prompt.isOk(cache, text.subtheme.hint.dirName)
} else {
return cache
}
}
21 changes: 0 additions & 21 deletions lib/prompt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,27 +147,6 @@ prompt.templateVersion = function templateVersion (cache) {
})
}


prompt.isOk = function isOk (cache, message) {
return new Promise(function (resolve, reject) {
let isOk = [
{
name: `isOk`,
type: 'confirm',
message: message
}
]
inquirer.prompt(isOk)
.then(function (answers) {
if (answers.isOk) {
resolve(cache)
} else {
process.exit(1)
}
})
})
}

prompt.isOk = function isOk (cache, message, fn) {
return new Promise(function (resolve, reject) {
let isOk = [
Expand Down

0 comments on commit 25b407a

Please sign in to comment.