MCPcopy
hub / github.com/louislam/dockge / composeFileExists

Method composeFileExists

backend/stack.ts:253–263  ·  view source on GitHub ↗

* Checks if a compose file exists in the specified directory. * @async * @static * @param {string} stacksDir - The directory of the stack. * @param {string} filename - The name of the directory to check for the compose file. * @returns {Promise } A promise that resol

(stacksDir : string, filename : string)

Source from the content-addressed store, hash-verified

251 * @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether any compose file exists.
252 */
253 static async composeFileExists(stacksDir : string, filename : string) : Promise<boolean> {
254 let filenamePath = path.join(stacksDir, filename);
255 // Check if any compose file exists
256 for (const filename of acceptedComposeFileNames) {
257 let composeFile = path.join(filenamePath, filename);
258 if (await fileExists(composeFile)) {
259 return true;
260 }
261 }
262 return false;
263 }
264
265 static async getStackList(server : DockgeServer, useCacheForManaged = false) : Promise<Map<string, Stack>> {
266 let stacksDir = server.stacksDir;

Callers 1

getStackListMethod · 0.80

Calls 2

fileExistsFunction · 0.90
joinMethod · 0.80

Tested by

no test coverage detected