edgeone 1.0.14-beta.3 → 1.0.14
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/edgeone-dist/cli.js +8 -7
- package/package.json +1 -1
package/edgeone-dist/cli.js
CHANGED
|
@@ -102539,7 +102539,7 @@ var yargs_default = Yargs;
|
|
|
102539
102539
|
// package.json
|
|
102540
102540
|
var package_default = {
|
|
102541
102541
|
name: "edgeone",
|
|
102542
|
-
version: "1.0.14
|
|
102542
|
+
version: "1.0.14",
|
|
102543
102543
|
description: "Command-line interface for TencentCloud Pages Functions",
|
|
102544
102544
|
bin: {
|
|
102545
102545
|
edgeone: "./edgeone-bin/edgeone.js"
|
|
@@ -114386,7 +114386,9 @@ var path7 = require("path");
|
|
|
114386
114386
|
function createFunctionsFolder() {
|
|
114387
114387
|
const folderPath = path7.join(process.cwd(), "functions");
|
|
114388
114388
|
if (fs7.existsSync(folderPath)) {
|
|
114389
|
+
console.log("Pages function folder already exists.");
|
|
114389
114390
|
} else {
|
|
114391
|
+
console.log("in createFunctionsFolder 2");
|
|
114390
114392
|
const filePath = path7.join(process.cwd(), "functions", "helloworld", "index.js");
|
|
114391
114393
|
const fileContent = `const json = JSON.stringify({
|
|
114392
114394
|
"code": 0,
|
|
@@ -114405,17 +114407,16 @@ export function onRequest(context) {
|
|
|
114405
114407
|
|
|
114406
114408
|
`;
|
|
114407
114409
|
fs7.mkdirSync(path7.dirname(filePath), { recursive: true });
|
|
114408
|
-
|
|
114409
|
-
|
|
114410
|
-
|
|
114411
|
-
|
|
114412
|
-
}
|
|
114410
|
+
try {
|
|
114411
|
+
fs7.writeFileSync(filePath, fileContent);
|
|
114412
|
+
} catch (e2) {
|
|
114413
|
+
console.error("Create function failed:", e2);
|
|
114414
|
+
}
|
|
114413
114415
|
}
|
|
114414
114416
|
}
|
|
114415
114417
|
async function PagesInit(yargs) {
|
|
114416
114418
|
await loginIfNot();
|
|
114417
114419
|
createFunctionsFolder();
|
|
114418
|
-
createFunctionsFolder();
|
|
114419
114420
|
okLog("Function example created!");
|
|
114420
114421
|
okLog("Project init success!");
|
|
114421
114422
|
process.exit(0);
|