@@ -17,9 +17,9 @@ import type { ReleaseContextType } from '@/types/release';
17
17
// of the current official managers versus the community ones
18
18
const CURRENT_OFFICIAL_MANAGERS = [ 'NVM' , 'DOCKER' ] ;
19
19
20
- const parseSnippet = ( s : string , { release , platform } : ReleaseContextType ) => {
20
+ const parseSnippet = ( s : string , releaseContext : ReleaseContextType ) => {
21
21
// 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' ) ;
23
23
24
24
// Evaluates the JavaScript code applying the release context to the code
25
25
interpreter . run ( `exports.content = \`${ s } \`` ) ;
@@ -49,9 +49,9 @@ const ReleaseCodeBox: FC = () => {
49
49
// Bundles the Platform and Package Manager snippets
50
50
`${ platformSnippet ?. content ?? '' } ${ packageManagerSnippet ?. content ?? '' } ` ,
51
51
// Passes a partial state of only the things we need to the parser
52
- { release, platform } as ReleaseContextType
52
+ { release, platform, os } as ReleaseContextType
53
53
) ;
54
- } , [ snippets , release , platform , packageManager ] ) ;
54
+ } , [ snippets , release , platform , os , packageManager ] ) ;
55
55
56
56
// Determines the code language based on the OS
57
57
const codeLanguage = os === 'WIN' ? 'ps1' : 'bash' ;
@@ -60,7 +60,7 @@ const ReleaseCodeBox: FC = () => {
60
60
< div className = "mb-6 mt-4 flex flex-col gap-2" >
61
61
{ semVer . lt ( release . versionWithPrefix , ESP_SUPPORT_THRESHOLD_VERSION ) && (
62
62
< AlertBox title = "Warning" level = "warning" size = "small" >
63
- { t ( 'layouts.download.codeBox.unsupportedVersionWarning' ) }
63
+ { t ( 'layouts.download.codeBox.unsupportedVersionWarning' ) }
64
64
</ AlertBox >
65
65
) }
66
66
0 commit comments