Skip to content

Commit ff61479

Browse files
authored
🏷️ Add NPM binary name to whitelabelling (#2175)
1 parent 547a13e commit ff61479

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.changeset/famous-apricots-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"myst-cli": patch
3+
---
4+
5+
Fix whitelabelling bug

packages/myst-cli/src/init/gh-actions/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import chalk from 'chalk';
55
import type { ISession } from 'myst-cli-utils';
66
import { writeFileToFolder } from 'myst-cli-utils';
77
import { getGithubUrl } from '../../utils/github.js';
8-
import { binaryName, readableName, npmPackageName } from '../../utils/whiteLabelling.js';
8+
import { npmBinaryName, readableName, npmPackageName } from '../../utils/whiteLabelling.js';
99
import { checkFolderIsGit, checkAtGitRoot } from '../../utils/git.js';
1010

1111
function createGithubPagesAction({
@@ -17,7 +17,7 @@ function createGithubPagesAction({
1717
defaultBranch?: string;
1818
isGithubIO?: boolean;
1919
}) {
20-
return `# This file was created automatically with \`${binaryName()} init --gh-pages\` 🪄 💚
20+
return `# This file was created automatically with \`${npmBinaryName()} init --gh-pages\` 🪄 💚
2121
# Ensure your GitHub Pages settings for this repository are set to deploy with **GitHub Actions**.
2222
2323
name: ${readableName()} GitHub Pages Deploy
@@ -61,7 +61,7 @@ jobs:
6161
- name: Install ${readableName()}
6262
run: npm install -g ${npmPackageName()}
6363
- name: Build HTML Assets
64-
run: ${binaryName()} build --html
64+
run: ${npmBinaryName()} build --html
6565
- name: Upload artifact
6666
uses: actions/upload-pages-artifact@v3
6767
with:
@@ -73,7 +73,7 @@ jobs:
7373
}
7474

7575
function createGithubCurvenoteAction({ defaultBranch = 'main' }: { defaultBranch?: string }) {
76-
return `# This file was created automatically with \`${binaryName()} init --gh-curvenote\` 🪄 💚
76+
return `# This file was created automatically with \`${npmBinaryName()} init --gh-curvenote\` 🪄 💚
7777
7878
name: Curvenote Deploy
7979
on:

packages/myst-cli/src/utils/whiteLabelling.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export function npmPackageName(): string {
1515
return (process.env.MYSTMD_NPM_PACKAGE_NAME ?? 'mystmd') as string;
1616
}
1717

18+
export function npmBinaryName(): string {
19+
return (process.env.MYSTMD_NPM_BINARY_NAME ?? 'myst') as string;
20+
}
21+
1822
export function homeURL(): string {
1923
return (process.env.MYSTMD_HOME_URL ?? 'https://mystmd.org') as string;
2024
}

0 commit comments

Comments
 (0)