@@ -63,10 +63,10 @@ const initFunction = async () => {
63
63
});
64
64
}
65
65
66
- const functionDir = path.join(functionFolder, answers.name );
66
+ const functionDir = path.join(functionFolder, answers.id );
67
67
68
68
if (fs.existsSync(functionDir)) {
69
- throw new Error(`( ${answers.name } ) already exists in the current directory. Please choose another name.`);
69
+ throw new Error(`( ${answers.id } ) already exists in the current directory. Please choose another name.`);
70
70
}
71
71
72
72
if (!answers.runtime.entrypoint) {
@@ -134,7 +134,7 @@ const initFunction = async () => {
134
134
135
135
fs.rmSync(`${functionDir}/${answers.runtime.id}`, { recursive: true, force: true });
136
136
137
- const readmePath = path.join(process.cwd(), 'functions', answers.name , 'README.md');
137
+ const readmePath = path.join(process.cwd(), 'functions', answers.id , 'README.md');
138
138
const readmeFile = fs.readFileSync(readmePath).toString();
139
139
const newReadmeFile = readmeFile.split('\n');
140
140
newReadmeFile[0] = `# ${answers.name}`;
@@ -154,7 +154,7 @@ const initFunction = async () => {
154
154
entrypoint: response.entrypoint,
155
155
commands: response.commands,
156
156
ignore: answers.runtime.ignore || null,
157
- path: `functions/${answers.name }`,
157
+ path: `functions/${answers.id }`,
158
158
};
159
159
160
160
localConfig.addFunction(data);
0 commit comments