diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b4aadb..8a37c82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log -## [0.1.0] - 2022-26-05 +## [0.0.2] - 2022-26-05 + +- Fix Linux support + +## [0.0.1] - 2022-26-05 - Initial release diff --git a/README.md b/README.md index 273b046..971024c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,13 @@ -# GI Gen +# GI Gen - Smart Gitignore Generator ## Features Create a gitignore file for your project automatically. -Uses [gi_gen](https://github.com/chenasraf/gi_gen) to operate, which can automatically discover your -project type, or you can choose manually. Also allows you to remove unused patterns from the -resulting file. +Can **automatically discover** your project type, or you can choose manually, and allows you to +**remove unused patterns** from the resulting file. + +Uses [gi_gen](https://github.com/chenasraf/gi_gen) to operate, which ## Requirements @@ -14,6 +15,10 @@ No requirements other than git, the binary is downloaded on first run. ## Release Notes -### 0.1.0 +### 0.0.2 -Initial release +- Fix Linux support + +### 0.0.1 + +- Initial release diff --git a/package.json b/package.json index 656c932..36c53f5 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "gi-gen", - "displayName": "GI Gen", + "displayName": "GI Gen - Smart Gitignore Generator", "description": "Generates a .gitignore for your project", "publisher": "casraf", "repository": "https://github.com/chenasraf/gi-gen-vscode-extension", "license": "MIT", - "version": "0.0.1", + "version": "0.0.2", "engines": { "vscode": "^1.67.0" }, diff --git a/src/utils.ts b/src/utils.ts index 191c16c..cf0f14b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -36,7 +36,13 @@ export function downloadFile(source: string, target: string): Promise { }) } -export type AvailablePlatform = 'macos-arm' | 'macos-intel' | 'windows' | 'linux' +export type AvailablePlatform = + | 'macos-arm' + | 'macos-intel' + | 'windows' + | 'linux-arm' + | 'linux-386' + | 'linux-amd64' export async function getPlatform(): Promise { const { platform } = process @@ -44,7 +50,7 @@ export async function getPlatform(): Promise { case 'darwin': return `macos-${await getMacArch()}` case 'linux': - return 'linux' + return `linux-${await getLinuxArch()}` case 'cygwin': case 'win32': return 'windows' @@ -53,6 +59,21 @@ export async function getPlatform(): Promise { } } +export async function getLinuxArch(): Promise<'arm' | 'amd64' | '386'> { + const res = await shellExec('uname', ['-m']) + switch (res) { + case 'i386': + case 'i686': + return '386' + case 'arm': + return 'arm' + case 'x86_64': + case 'amd64': + default: + return 'amd64' + } +} + export async function getMacArch(): Promise<'arm' | 'intel'> { try { await shellExec('sysctl', ['sysctl.proc_translated'])