From 42d973bcc6fa9a3318cbfaadac07172414f4b17f Mon Sep 17 00:00:00 2001 From: Max Howell Date: Thu, 29 Sep 2022 13:56:55 -0400 Subject: [PATCH] symlink is needed for tea/cli (#37) --- README.md | 2 +- action.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f969e66f..dfe12272 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [`install.sh`](./install.sh) is delivered when you `curl tea.xyz`. -# GitHub Action 0.5.3 +# GitHub Action 0.5.4 This repository also provides the `tea` GitHub Action. diff --git a/action.js b/action.js index dc46fb41..c095b94e 100644 --- a/action.js +++ b/action.js @@ -5,7 +5,7 @@ const fs = require('fs') const os = require("os") async function go() { - process.stdout.write("installing tea…\n") + process.stderr.write("determining latest tea version…\n") const PREFIX = process.env['INPUT_PREFIX'] || `${os.homedir()}/opt` const TEA_DIR = (() => { @@ -49,7 +49,7 @@ async function go() { }).on('error', reject) }) - process.stdout.write(`fetching tea.xyz@${v}\n`) + process.stderr.write(`fetching tea.xyz@${v}\n`) fs.mkdirSync(PREFIX, { recursive: true }) @@ -66,6 +66,12 @@ async function go() { throw new Error(`tar: ${exitcode}`) } + const oldwd = process.cwd() + process.chdir(`${PREFIX}/tea.xyz`) + fs.symlinkSync(`v${v}`, `v*`, 'dir') + fs.symlinkSync(`v${v}`, `v0`, 'dir') //FIXME + process.chdir(oldwd) + const GITHUB_PATH = process.env['GITHUB_PATH'] const bindir = `${PREFIX}/tea.xyz/v${v}/bin` fs.appendFileSync(GITHUB_PATH, `${bindir}\n`, {encoding: 'utf8'}) @@ -103,6 +109,8 @@ async function go() { } process.stdout.write(`::set-output name=prefix::${PREFIX}`) + + process.stderr.write(`installed ${PREFIX}/tea.xyz/v${v}\n`) } go().catch(err => {