Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit 64251f3

Browse files
author
sw-yx
committed
auto chmod copied template files
1 parent 82a34f1 commit 64251f3

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/commands/functions/create.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ async function scaffoldFromTemplate(flags, args, functionsDir) {
334334
if (err) throw err;
335335
createdFiles.forEach(filePath => {
336336
this.log(`Created ${filePath}`);
337+
require("fs").chmodSync(path.resolve(filePath), 0o777);
337338
if (filePath.includes("package.json")) hasPackageJSON = true;
338339
});
339340
// rename functions with different names from default
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
const execa = require('execa')
1+
const execa = require("execa");
22
module.exports = {
3-
name: 'fauna-crud',
4-
description: 'CRUD function using Fauna DB',
3+
name: "fauna-crud",
4+
description: "CRUD function using Fauna DB",
55
addons: [
66
{
7-
addonName: 'fauna',
7+
addonName: "fauna",
88
addonDidInstall(fnPath) {
9-
require('fs').chmodSync(fnPath + '/create-schema.js', 0o777)
10-
execa.sync(fnPath + '/create-schema.js', undefined, { env: process.env, stdio: 'inherit' })
9+
execa.sync(fnPath + "/create-schema.js", undefined, {
10+
env: process.env,
11+
stdio: "inherit"
12+
});
1113
}
1214
}
1315
],
1416
onComplete() {
15-
console.log(`fauna-crud function created from template!`)
17+
console.log(`fauna-crud function created from template!`);
1618
}
17-
}
19+
};

src/functions-templates/js/fauna-graphql-dev/.netlify-function-template.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module.exports = {
66
{
77
addonName: "fauna",
88
addonDidInstall(fnPath) {
9-
require("fs").chmodSync(fnPath + "/sync-schema.js", 0o777);
109
execa.sync(fnPath + "/sync-schema.js", undefined, {
1110
env: process.env,
1211
stdio: "inherit"

0 commit comments

Comments
 (0)