ol-base-components 2.9.1 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/api/api.js
CHANGED
|
@@ -75,6 +75,10 @@ SwaggerClient(swaggerUrl)
|
|
|
75
75
|
|
|
76
76
|
Object.keys(apiModules).forEach(fileName => {
|
|
77
77
|
const outputPath = path.join(modulesDir, `${fileName}.js`);
|
|
78
|
+
// 如果文件已存在,先删除(包括只读文件)
|
|
79
|
+
if (fs.existsSync(outputPath)) {
|
|
80
|
+
fs.unlinkSync(outputPath);
|
|
81
|
+
}
|
|
78
82
|
fs.writeFileSync(outputPath, apiModules[fileName], "utf-8");
|
|
79
83
|
setFileReadOnly(outputPath);
|
|
80
84
|
console.log(`API接口已生成并保存到 ${outputPath}(只读)`);
|
|
@@ -97,6 +101,10 @@ function createIndexFile(apiModules) {
|
|
|
97
101
|
str += `export * from "./${fileName}";\n`;
|
|
98
102
|
});
|
|
99
103
|
const outputPath = path.join(modulesDir, `index.js`);
|
|
104
|
+
// 如果文件已存在,先删除(包括只读文件)
|
|
105
|
+
if (fs.existsSync(outputPath)) {
|
|
106
|
+
fs.unlinkSync(outputPath);
|
|
107
|
+
}
|
|
100
108
|
fs.writeFileSync(outputPath, str, "utf-8");
|
|
101
109
|
// 设置 index.js 也为只读
|
|
102
110
|
setFileReadOnly(outputPath);
|
package/src/api/run.js
CHANGED
|
@@ -77,6 +77,10 @@ http
|
|
|
77
77
|
|
|
78
78
|
// 输出到文件
|
|
79
79
|
// const outputPath = path.join(__dirname, "swagger.js");
|
|
80
|
+
// 如果文件已存在,先删除(包括只读文件)
|
|
81
|
+
if (fs.existsSync(outputPath)) {
|
|
82
|
+
fs.unlinkSync(outputPath);
|
|
83
|
+
}
|
|
80
84
|
fs.writeFileSync(outputPath, apiEndpoints, "utf-8");
|
|
81
85
|
clearInterval(spinner);
|
|
82
86
|
process.stdout.write("\r");
|