Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw new Error(`Make sure you define a value for the option ${options.set}`)
}
if (options.set && value) { // 设置选项
set(config, options.set, value)
if (value.match('[0-9]')) {
set(config, options.set, parseInt(value))
}
if (value === 'true') {
set(config, options.set, true)
}
if (value === 'false') {
set(config, options.set, false)
}
await fs.writeFile(file, JSON.stringify(config, null, 2), 'utf-8')
if (options.json) {
console.log(JSON.stringify({
updated: options.set
}))
} else {
console.log(`You have updated the option: ${options.set} to ${value}`)
}
}
}
}
}
if (options.edit) { // 启用编辑器编辑 .vuerc
launch(file)
}
if (options.set && !value) {
throw new Error(`Make sure you define a value for the option ${options.set}`)
}
if (options.set && value) { // 设置选项
set(config, options.set, value)
if (value.match('[0-9]')) {
set(config, options.set, parseInt(value))
}
if (value === 'true') {
set(config, options.set, true)
}
if (value === 'false') {
set(config, options.set, false)
}
await fs.writeFile(file, JSON.stringify(config, null, 2), 'utf-8')
if (options.json) {
console.log(JSON.stringify({
updated: options.set
}))
} else {
}))
} else {
console.log(`You have removed the option: ${options.delete}`)
}
}
if (options.edit) { // 启用编辑器编辑 .vuerc
launch(file)
}
if (options.set && !value) {
throw new Error(`Make sure you define a value for the option ${options.set}`)
}
if (options.set && value) { // 设置选项
set(config, options.set, value)
if (value.match('[0-9]')) {
set(config, options.set, parseInt(value))
}
if (value === 'true') {
set(config, options.set, true)
}
if (value === 'false') {
set(config, options.set, false)
}
await fs.writeFile(file, JSON.stringify(config, null, 2), 'utf-8')
if (options.json) {
console.log(JSON.stringify({
throw new Error(`Make sure you define a value for the option ${options.set}`)
}
if (options.set && value) {
set(config, options.set, value)
if (value.match('[0-9]')) {
set(config, options.set, parseInt(value))
}
if (value === 'true') {
set(config, options.set, true)
}
if (value === 'false') {
set(config, options.set, false)
}
await fs.writeFile(file, JSON.stringify(config, null, 2), 'utf-8')
if (options.json) {
console.log(JSON.stringify({
updated: options.set
}))
} else {
console.log(`You have updated the option: ${options.set} to ${value}`)
}
}
}
}
}
if (options.edit) {
launch(file)
}
if (options.set && !value) {
throw new Error(`Make sure you define a value for the option ${options.set}`)
}
if (options.set && value) {
set(config, options.set, value)
if (value.match('[0-9]')) {
set(config, options.set, parseInt(value))
}
if (value === 'true') {
set(config, options.set, true)
}
if (value === 'false') {
set(config, options.set, false)
}
await fs.writeFile(file, JSON.stringify(config, null, 2), 'utf-8')
if (options.json) {
console.log(JSON.stringify({
updated: options.set
}))
} else {
}))
} else {
console.log(`You have removed the option: ${options.delete}`)
}
}
if (options.edit) {
launch(file)
}
if (options.set && !value) {
throw new Error(`Make sure you define a value for the option ${options.set}`)
}
if (options.set && value) {
set(config, options.set, value)
if (value.match('[0-9]')) {
set(config, options.set, parseInt(value))
}
if (value === 'true') {
set(config, options.set, true)
}
if (value === 'false') {
set(config, options.set, false)
}
await fs.writeFile(file, JSON.stringify(config, null, 2), 'utf-8')
if (options.json) {
console.log(JSON.stringify({
function setAnswer (id, value) {
set(answers, id, value)
}