Skip to content

Commit 5b76dc5

Browse files
committed
chore: some minor code review changes
1 parent 9d9a13d commit 5b76dc5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

apps/site/components/Downloads/Release/ReleaseCodeBox.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import type { ReleaseContextType } from '@/types/release';
1717
// of the current official managers versus the community ones
1818
const CURRENT_OFFICIAL_MANAGERS = ['NVM', 'DOCKER'];
1919

20-
const parseSnippet = (s: string, { release, platform }: ReleaseContextType) => {
20+
const parseSnippet = (s: string, releaseContext: ReleaseContextType) => {
2121
// Creates a minimal JavaScript interpreter for parsing the JavaScript code from the snippets
22-
const interpreter = createSval({ props: { release, platform } }, 'script');
22+
const interpreter = createSval({ props: releaseContext }, 'script');
2323

2424
// Evaluates the JavaScript code applying the release context to the code
2525
interpreter.run(`exports.content = \`${s}\``);
@@ -49,9 +49,9 @@ const ReleaseCodeBox: FC = () => {
4949
// Bundles the Platform and Package Manager snippets
5050
`${platformSnippet?.content ?? ''}${packageManagerSnippet?.content ?? ''}`,
5151
// Passes a partial state of only the things we need to the parser
52-
{ release, platform } as ReleaseContextType
52+
{ release, platform, os } as ReleaseContextType
5353
);
54-
}, [snippets, release, platform, packageManager]);
54+
}, [snippets, release, platform, os, packageManager]);
5555

5656
// Determines the code language based on the OS
5757
const codeLanguage = os === 'WIN' ? 'ps1' : 'bash';
@@ -60,7 +60,7 @@ const ReleaseCodeBox: FC = () => {
6060
<div className="mb-6 mt-4 flex flex-col gap-2">
6161
{semVer.lt(release.versionWithPrefix, ESP_SUPPORT_THRESHOLD_VERSION) && (
6262
<AlertBox title="Warning" level="warning" size="small">
63-
{t('layouts.download.codeBox.unsupportedVersionWarning')}&nbsp;
63+
{t('layouts.download.codeBox.unsupportedVersionWarning')}
6464
</AlertBox>
6565
)}
6666

apps/site/snippets/en/download/pnpm.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
# Enable Corepack:
3-
corepack enable
3+
${props.os === 'WIN' ?
4+
'corepack enable pnpm' :
5+
'curl -fsSL https://get.pnpm.io/install.sh | sh -'}
46

57
# Verify pnpm version:
68
${props.platform === 'DOCKER' ?

0 commit comments

Comments
 (0)