Skip to content

Commit

Permalink
[cli] fix: mops update on renamed github package
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenVoich committed Nov 16, 2023
1 parent 70e166d commit c01e531
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cli/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type AddOptions = {
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function add(name: string, {verbose = false, dev = false, lockfile}: AddOptions = {}) {
export async function add(name: string, {verbose = false, dev = false, lockfile}: AddOptions = {}, asName?: string) {
if (!checkConfigFile()) {
return;
}
Expand Down Expand Up @@ -57,7 +57,7 @@ export async function add(name: string, {verbose = false, dev = false, lockfile}
}

pkgDetails = {
name: parseGithubURL(name).gitName,
name: asName || parseGithubURL(name).gitName,
repo: `https://github.com/${org}/${gitName}#${branch}@${commitHash}`,
version: '',
};
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function update(pkg?: string, {lockfile}: UpdateOptions = {}) {
let dev = !!config['dev-dependencies']?.[dep.name];
let commit = await getGithubCommit(`${org}/${gitName}`, branch);
if (commit.sha !== commitHash) {
await add(`https://github.com/${org}/${gitName}#${branch}@${commit.sha}`, {dev});
await add(`https://github.com/${org}/${gitName}#${branch}@${commit.sha}`, {dev}, dep.name);
}
}

Expand Down

0 comments on commit c01e531

Please sign in to comment.