1- const { plumbing , hooks, Path, utils, semver, SemVer } = require ( "@teaxyz/lib" )
1+ const { porcelain , hooks, Path, utils, semver, SemVer } = require ( "@teaxyz/lib" )
22const { getExecOutput, exec } = require ( "@actions/exec" )
3- const { install, link, resolve, hydrate } = plumbing
43const { useConfig, useSync, useCellar } = hooks
54const core = require ( '@actions/core' )
5+ const { install } = porcelain
66const path = require ( 'path' )
77const os = require ( "os" )
88
@@ -27,7 +27,7 @@ async function go() {
2727 const pkgs = [ `tea.xyz${ vtea } ` ]
2828 for ( let key in process . env ) {
2929 if ( key . startsWith ( "INPUT_+" ) ) {
30- const value = process . env [ key ]
30+ const value = process . env [ key ] !
3131 if ( key == 'INPUT_+' ) {
3232 for ( const item of value . split ( / \s + / ) ) {
3333 if ( item . trim ( ) ) {
@@ -52,14 +52,8 @@ async function go() {
5252 UserAgent : 'tea.setup/0.1.0' , //TODO version
5353 options : { compression : 'gz' }
5454 } )
55- await useSync ( )
56- const { pkgs : tree } = await hydrate ( pkgs . map ( utils . pkg . parse ) )
57- const { pending } = await resolve ( tree )
58- for ( const pkg of pending ) {
59- core . info ( `installing ${ utils . pkg . str ( pkg ) } ` )
60- const installation = await install ( pkg )
61- await link ( installation )
62- }
55+
56+ await install ( pkgs )
6357
6458 const tea = await useCellar ( ) . resolve ( { project : 'tea.xyz' , constraint : new semver . Range ( '*' ) } )
6559 const teafile = tea . path . join ( 'bin/tea' ) . string
@@ -112,7 +106,7 @@ async function go() {
112106
113107 if ( os . platform ( ) != 'darwin' ) {
114108 const sh = path . join ( path . dirname ( __filename ) , "install-pre-reqs.sh" )
115- if ( process . getuid ( ) == 0 ) {
109+ if ( process . getuid && process . getuid ( ) == 0 ) {
116110 await exec ( sh )
117111 } else {
118112 await exec ( 'sudo' , [ sh ] )
0 commit comments