Skip to content

Commit

Permalink
Merge pull request #14 from umccr/feat/git-force
Browse files Browse the repository at this point in the history
fix: check for existing directory
  • Loading branch information
mmalenic authored Feb 19, 2025
2 parents 5316974 + 3ca43d9 commit 596b001
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions lib/htsget-lambda.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readFileSync, mkdirSync } from "fs";
import { readFileSync, mkdirSync, existsSync } from "fs";
import { join } from "node:path";
import { tmpdir } from "os";

Expand Down Expand Up @@ -87,10 +87,12 @@ export class HtsgetLambda extends Construct {
}

args.push(gitRemote, localPath);
exec("git", args);
if (!existsSync(localPath)) {
exec("git", args);

if (gitReference !== "HEAD") {
exec("git", ["checkout", gitReference], { cwd: localPath });
if (gitReference !== "HEAD") {
exec("git", ["checkout", gitReference], { cwd: localPath });
}
}

const manifestPath = getManifestPath({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
"watch": "tsc -w",
"typedoc": "typedoc"
},
"version": "0.8.5"
"version": "0.8.6"
}

0 comments on commit 596b001

Please sign in to comment.