mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-24 16:45:22 +02:00
Refactor Bitbucket repository cloning logic: remove unused parameter and enhance error handling by retrieving Bitbucket provider directly within the function.
This commit is contained in:
@@ -87,7 +87,6 @@ interface CloneBitbucketRepository {
|
||||
bitbucketOwner: string | null;
|
||||
bitbucketBranch: string | null;
|
||||
bitbucketId: string | null;
|
||||
bitbucket: Bitbucket | null;
|
||||
enableSubmodules: boolean;
|
||||
serverId: string | null;
|
||||
type?: "application" | "compose";
|
||||
@@ -104,7 +103,6 @@ export const cloneBitbucketRepository = async ({
|
||||
bitbucketOwner,
|
||||
bitbucketBranch,
|
||||
bitbucketId,
|
||||
bitbucket,
|
||||
enableSubmodules,
|
||||
serverId,
|
||||
} = entity;
|
||||
@@ -114,7 +112,12 @@ export const cloneBitbucketRepository = async ({
|
||||
command += `echo "Error: ❌ Bitbucket Provider not found"; exit 1;`;
|
||||
return command;
|
||||
}
|
||||
const bitbucket = await findBitbucketById(bitbucketId);
|
||||
|
||||
if (!bitbucket) {
|
||||
command += `echo "Error: ❌ Bitbucket Provider not found"; exit 1;`;
|
||||
return command;
|
||||
}
|
||||
const basePath = type === "compose" ? COMPOSE_PATH : APPLICATIONS_PATH;
|
||||
const outputPath = join(basePath, appName, "code");
|
||||
command += `rm -rf ${outputPath};`;
|
||||
|
||||
Reference in New Issue
Block a user