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