mirror of
https://github.com/Borales/actions-yarn.git
synced 2026-06-25 01:29:26 +08:00
Switching to yarn
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ import {ensureYarnIsInstalled} from './yarn'
|
||||
import {run} from './run'
|
||||
import {resolve} from 'path'
|
||||
|
||||
const main = async () => {
|
||||
const main = async (): Promise<void> => {
|
||||
await ensureYarnIsInstalled()
|
||||
|
||||
const cmd: string = getInput('cmd', {required: true})
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import {exec} from '@actions/exec'
|
||||
|
||||
export const run = async (cmd: string, {cwd}: {cwd: string}) => {
|
||||
export const run = async (cmd: string, {cwd}: {cwd: string}): Promise<void> => {
|
||||
await exec('yarn', cmd.split(' '), {cwd})
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import {debug, setOutput} from '@actions/core'
|
||||
import {exec, getExecOutput} from '@actions/exec'
|
||||
import {which} from '@actions/io'
|
||||
|
||||
export const ensureYarnIsInstalled = async () => {
|
||||
export const ensureYarnIsInstalled = async (): Promise<void> => {
|
||||
try {
|
||||
await which('yarn', true)
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user