Skip to content

Commit

Permalink
[cli] If branch is not specified, resolve value to undefined (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
junhoyeo authored Mar 5, 2023
1 parent 57e24c9 commit 81f37cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/submodules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export const fetchSubmodules = async (
pathName = pathName.split('/').slice(-1)[0];

const resolvingBranch =
zx.$`git config --file .gitmodules --get submodule.${gitModulePath}.branch`.then(
(output) => output.stdout.trim() || undefined,
);
zx.$`git config --file .gitmodules --get submodule.${gitModulePath}.branch`
.then((output) => output.stdout.trim() || undefined)
.catch(() => /* if branch is not specified */ undefined);
const resolvingURL =
zx.$`git config --file .gitmodules --get submodule.${gitModulePath}.url`.then(
(output) => output.stdout.trim(),
Expand Down

0 comments on commit 81f37cd

Please sign in to comment.