From 415ae8ee5972018024675af56af8b3938b779678 Mon Sep 17 00:00:00 2001 From: ilkecan Date: Sun, 26 Jun 2022 20:25:47 +0000 Subject: [PATCH] Remove the hardcoded tutorial script extension Parameterized it according to the chosen NS version. --- .../InteractiveTutorial/InteractiveTutorialRoot.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx index 93e1af52c..92074ea38 100644 --- a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx +++ b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx @@ -58,11 +58,12 @@ export function InteractiveTutorialRoot(): React.ReactElement { const [language, setLanguage] = useState(Language.None); const classes = useStyles(); - const tutorialScriptName = { - [Language.None]: "n00dles.script", - [Language.NS1]: "n00dles.script", - [Language.NS2]: "n00dles.js", + const tutorialScriptExtension = { + [Language.None]: ".script", + [Language.NS1]: ".script", + [Language.NS2]: ".js", }[language]; + const tutorialScriptName = `n00dles${tutorialScriptExtension}`; const contents: { [number: string]: IContent | undefined } = { [iTutorialSteps.Start as number]: { @@ -377,7 +378,9 @@ export function InteractiveTutorialRoot(): React.ReactElement { {"[home ~/]> nano"} - Scripts must end with the .script extension. Let's make a script now by entering + + Scripts must end with the {tutorialScriptExtension} extension. Let's make a script now by entering{" "} + {`[home ~/]> nano ${tutorialScriptName}`}