Skip to content

Commit 642633b

Browse files
committed
feat: add asdf install method
1 parent b97f706 commit 642633b

5 files changed

Lines changed: 33 additions & 2 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# asdf has specific installation instructions for each operating system.
2+
# Please refer to the official documentation at https://asdf-vm.com/guide/getting-started.html.
3+
4+
# Install the Node.js plugin:
5+
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
6+
7+
# Download and install Node.js:
8+
asdf install nodejs ${props.release.version}
9+
10+
# Set Node.js as the global default:
11+
asdf set -u nodejs ${props.release.version}

apps/site/types/release.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export type InstallationMethod =
88
| 'BREW'
99
| 'DOCKER'
1010
| 'CHOCO'
11-
| 'N';
11+
| 'N'
12+
| 'ASDF';
1213
export type PackageManager = 'NPM' | 'YARN' | 'PNPM';
1314

1415
// Items with a pipe/default value mean that they are auto inferred

apps/site/util/download/constants.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,15 @@
187187
},
188188
"url": "https://github.com/tj/n",
189189
"info": "layouts.download.codeBox.platformInfo.n"
190+
},
191+
{
192+
"id": "ASDF",
193+
"name": "asdf",
194+
"compatibility": {
195+
"os": ["MAC", "LINUX"]
196+
},
197+
"url": "https://asdf-vm.com/guide/getting-started.html",
198+
"info": "layouts.download.codeBox.platformInfo.asdf"
190199
}
191200
],
192201
"packageManagers": [

apps/site/util/download/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,18 @@ export const parseCompat = <
7878
*/
7979
const createIcon = (
8080
IconModule: Record<string, ElementType>,
81-
iconName: string
81+
iconName?: string
8282
) => {
83+
if (!iconName) {
84+
return undefined;
85+
}
86+
8387
const IconComponent = IconModule[iconName];
88+
89+
if (!IconComponent) {
90+
return undefined;
91+
}
92+
8493
return <IconComponent width={16} height={16} />;
8594
};
8695

packages/i18n/src/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@
299299
"choco": "Chocolatey is a package manager for Windows.",
300300
"docker": "Docker is a containerization platform.",
301301
"n": "\"n\" is a cross-platform Node.js version manager.",
302+
"asdf": "\"asdf\" is a cross-platform version manager that supports multiple languages.",
302303
"volta": "\"Volta\" is a cross-platform Node.js version manager."
303304
}
304305
}

0 commit comments

Comments
 (0)