Skip to content

Commit

Permalink
fix cli tool from crashing when handling author URL input; add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
cherriechang committed Jan 30, 2025
1 parent 0040c6e commit ec57500
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/fifty-tables-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@jspsych/new-extension": patch
"@jspsych/new-timeline": patch
"@jspsych/new-plugin": patch
---

This patch fixes the getGitHttpsUrl(await getRemoteGitUrl()) call in cli.js of the new-plugin, new-extension and new-timeline packages so that this line does not crash from calling getGitHttpsUrl() on a promise.
3 changes: 2 additions & 1 deletion packages/new-extension/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ async function runPrompts(cwdInfo) {
// If not in the jspsych-contrib repository, ask for the path to the README.md file
let readmePath;
if (!cwdInfo.isContribRepo) {
const remoteGitUrl = await getRemoteGitUrl();
readmePath = await input({
message: "Enter the path to the README.md file for this extension package [Optional]:",
default: `${getGitHttpsUrl(await getRemoteGitUrl())}/extension-${name}/README.md`, // '/extension-${name}/README.md' if not a Git repository
default: `${getGitHttpsUrl(remoteGitUrl)}/extension-${name}/README.md`, // '/extension-${name}/README.md' if not a Git repository
});
} else {
readmePath = `https://github.com/jspsych/jspsych-contrib/packages/extension-${name}/README.md`;
Expand Down
3 changes: 2 additions & 1 deletion packages/new-timeline/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ async function runPrompts(cwdInfo) {

// If not in the jspsych-timelines repository, ask for the path to the README.md file
let readmePath;
const remoteGitUrl = await getRemoteGitUrl();
if (!cwdInfo.isTimelinesRepo) {
readmePath = await input({
message: "Enter the path to the README.md file for this timeline package [Optional]:",
default: `${getGitHttpsUrl(await getRemoteGitUrl())}/timeline-${name}/README.md`, // '/timeline-${name}/README.md' if not a Git repository
default: `${getGitHttpsUrl(remoteGitUrl)}/timeline-${name}/README.md`, // '/timeline-${name}/README.md' if not a Git repository
});
} else {
readmePath = `https://github.com/jspsych/jspsych-timelines/packages/timeline-${name}/README.md`;
Expand Down

0 comments on commit ec57500

Please sign in to comment.