mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-07 19:44:35 +08:00
update files
This commit is contained in:
parent
463b8998e5
commit
26eec2faf6
@ -62,26 +62,34 @@ function verifyConfigure(configure){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!project.path || typeof project.path !== 'string') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (Array.isArray(project.env)) {
|
if (Array.isArray(project.env)) {
|
||||||
if (
|
var envValid = project.env.every(function (env){
|
||||||
!project.env.every(function (env){
|
return env.name && typeof env.name === 'string'
|
||||||
return env.name && typeof env.name === 'string'
|
&& env.value && typeof env.value === 'string';
|
||||||
&& env.value && typeof env.value === 'string';
|
});
|
||||||
})
|
|
||||||
) {
|
if (!envValid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(project.command)) {
|
if (Array.isArray(project.command)) {
|
||||||
if (
|
var commandValid = project.command.every(function (command){
|
||||||
!project.command.every(function (command){
|
return command.name && typeof command.name === 'string'
|
||||||
return command.name && typeof command.name === 'string'
|
&& command.value && typeof command.value === 'string';
|
||||||
&& command.value && typeof command.value === 'string';
|
});
|
||||||
})
|
|
||||||
) {
|
if (commandValid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -60,7 +60,7 @@ module.exports = Vue.component('app-configure', {
|
|||||||
this.submitError = '项目已存在';
|
this.submitError = '项目已存在';
|
||||||
} else {
|
} else {
|
||||||
this.showPopup = false;
|
this.showPopup = false;
|
||||||
this.configure.projects.push({ name: this.name, path: this.path });
|
this.configure.projects.push({ name: this.name, path: this.path, env: [], command: [] });
|
||||||
|
|
||||||
this.submitError = '';
|
this.submitError = '';
|
||||||
|
|
||||||
|
@ -37,17 +37,7 @@ module.exports = Vue.component('app-main', {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
project: function (){
|
project: function (){
|
||||||
var project = util.clone(this.projects[this.activeIndex]);
|
return util.clone(this.projects[this.activeIndex]);
|
||||||
|
|
||||||
if (!project.env) {
|
|
||||||
project.env = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!project.command) {
|
|
||||||
project.command = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return project;
|
|
||||||
},
|
},
|
||||||
command: function (){
|
command: function (){
|
||||||
return this.project.command.slice(0, 3);
|
return this.project.command.slice(0, 3);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user