From ca3d88ae49fe0ced7a014683ce0833b3fc8fa5b3 Mon Sep 17 00:00:00 2001 From: Nikita Grishko Date: Tue, 13 Jul 2021 17:34:07 +0200 Subject: [PATCH] [feat] macos support #21 --- .github/workflows/default.yml | 2 +- README.md | 4 ++++ dist/index.js | 10 +++++----- src/find.ts | 9 +++++---- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index bfbc42b..392028d 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -30,7 +30,7 @@ jobs: matrix: python-version: [3.6, 3.7, 3.8, 3.9] poetry-version: [1.1.7, 1.2.0a1] - os: [ubuntu-latest, windows-latest] + os: [macos-latest, ubuntu-latest, windows-latest] fail-fast: true diff --git a/README.md b/README.md index 6143e37..4588a02 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,10 @@ This action supports versions of: ## Changelog +### v7 + +- **Fix**, support MacOS platform #21 + ### v6 - Support Windows platform #19 diff --git a/dist/index.js b/dist/index.js index dd56855..90a58ac 100644 --- a/dist/index.js +++ b/dist/index.js @@ -49,11 +49,11 @@ function getPoetryInstallArgs(inputs) { return args; } function getPoetryPathArgs() { - if (os_1.default.platform() === "win32") { - return ["AppData", "Roaming", "Python", "Scripts"]; - } - else { - return [".local", "share", "pypoetry", "bin"]; + switch (os_1.default.platform()) { + case "win32": + return ["AppData", "Roaming", "Python", "Scripts"]; + default: + return [".local", "bin"]; } } diff --git a/src/find.ts b/src/find.ts index 90d502e..1617772 100644 --- a/src/find.ts +++ b/src/find.ts @@ -34,9 +34,10 @@ function getPoetryInstallArgs(inputs: Inputs): string[] { } function getPoetryPathArgs(): string[] { - if (os.platform() === "win32") { - return ["AppData", "Roaming", "Python", "Scripts"] - } else { - return [".local", "share", "pypoetry", "bin"] + switch (os.platform()) { + case "win32": + return ["AppData", "Roaming", "Python", "Scripts"] + default: + return [".local", "bin"] } }