Fixed build
This commit is contained in:
parent
c711509c02
commit
b5f32aa696
|
|
@ -114,9 +114,24 @@ function convertV2toV4(v2String) {
|
||||||
|
|
||||||
|
|
||||||
function buildDist() {
|
function buildDist() {
|
||||||
return fs.readdir(pathOfSourceDirectoryApps)
|
return Promise.resolve()
|
||||||
|
.then(function () {
|
||||||
|
return fs.existsSync(pathOfSourceDirectoryApps)
|
||||||
|
})
|
||||||
|
.then(function (dirExists) {
|
||||||
|
|
||||||
|
if (!dirExists) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return fs.readdir(pathOfSourceDirectoryApps);
|
||||||
|
})
|
||||||
.then(function (appsFileNames) { // [ app1.json app2.json .... ]
|
.then(function (appsFileNames) { // [ app1.json app2.json .... ]
|
||||||
|
|
||||||
|
if (appsFileNames.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
appsFileNames.forEach(appFileName => {
|
appsFileNames.forEach(appFileName => {
|
||||||
const pathOfAppFileInSource = path.join(pathOfSourceDirectoryApps, appFileName);
|
const pathOfAppFileInSource = path.join(pathOfSourceDirectoryApps, appFileName);
|
||||||
|
|
||||||
|
|
@ -143,8 +158,7 @@ function buildDist() {
|
||||||
fs.outputJsonSync(path.join(pathOfDistV2, 'list'), v3List); // TODO delete oneClickApps:
|
fs.outputJsonSync(path.join(pathOfDistV2, 'list'), v3List); // TODO delete oneClickApps:
|
||||||
fs.outputJsonSync(path.join(pathOfDistV3, 'list'), v3List);
|
fs.outputJsonSync(path.join(pathOfDistV3, 'list'), v3List);
|
||||||
fs.outputJsonSync(path.join(pathOfDistV4, 'list'), v3List);
|
fs.outputJsonSync(path.join(pathOfDistV4, 'list'), v3List);
|
||||||
})
|
|
||||||
.then(function () {
|
|
||||||
return fs.copySync(path.join(pathOfPublic, 'CNAME'), path.join(pathOfDist, 'CNAME'));
|
return fs.copySync(path.join(pathOfPublic, 'CNAME'), path.join(pathOfDist, 'CNAME'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue