@@ -47,7 +47,7 @@ async function dockerBuild(func, variables) {
47
47
const runtimeName = runtimeChunks.join("-");
48
48
const imageName = `openruntimes/${runtimeName}:${openRuntimesVersion}-${runtimeVersion}`;
49
49
50
- const functionDir = path.join(process.cwd (), func.path);
50
+ const functionDir = path.join(localConfig.getDirname (), func.path);
51
51
52
52
const id = func.$id;
53
53
@@ -124,7 +124,7 @@ async function dockerBuild(func, variables) {
124
124
return;
125
125
}
126
126
127
- const copyPath = path.join(process.cwd (), func.path, '.appwrite', 'build.tar.gz');
127
+ const copyPath = path.join(localConfig.getDirname (), func.path, '.appwrite', 'build.tar.gz');
128
128
const copyDir = path.dirname(copyPath);
129
129
if (!fs.existsSync(copyDir)) {
130
130
fs.mkdirSync(copyDir, { recursive: true });
@@ -143,7 +143,7 @@ async function dockerBuild(func, variables) {
143
143
144
144
await dockerStop(id);
145
145
146
- const tempPath = path.join(process.cwd (), func.path, 'code.tar.gz');
146
+ const tempPath = path.join(localConfig.getDirname (), func.path, 'code.tar.gz');
147
147
if (fs.existsSync(tempPath)) {
148
148
fs.rmSync(tempPath, { force: true });
149
149
}
@@ -153,7 +153,7 @@ async function dockerBuild(func, variables) {
153
153
154
154
async function dockerStart(func, variables, port) {
155
155
// Pack function files
156
- const functionDir = path.join(process.cwd (), func.path);
156
+ const functionDir = path.join(localConfig.getDirname (), func.path);
157
157
158
158
const runtimeChunks = func.runtime.split("-");
159
159
const runtimeVersion = runtimeChunks.pop();
@@ -211,12 +211,12 @@ async function dockerCleanup(functionId) {
211
211
await dockerStop(functionId);
212
212
213
213
const func = localConfig.getFunction(functionId);
214
- const appwritePath = path.join(process.cwd (), func.path, '.appwrite');
214
+ const appwritePath = path.join(localConfig.getDirname (), func.path, '.appwrite');
215
215
if (fs.existsSync(appwritePath)) {
216
216
fs.rmSync(appwritePath, { recursive: true, force: true });
217
217
}
218
218
219
- const tempPath = path.join(process.cwd (), func.path, 'code.tar.gz');
219
+ const tempPath = path.join(localConfig.getDirname (), func.path, 'code.tar.gz');
220
220
if (fs.existsSync(tempPath)) {
221
221
fs.rmSync(tempPath, { force: true });
222
222
}
0 commit comments