File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as core from '@actions/core' ;
22import * as exec from '@actions/exec' ;
3+ import fs from 'fs' ;
4+ import os from 'os' ;
5+ import path from 'path' ;
36
47type SupportedPackageManagers = {
58 [ prop : string ] : PackageManagerInfo ;
@@ -19,7 +22,7 @@ export const supportedPackageManagers: SupportedPackageManagers = {
1922 pnpm : {
2023 lockFilePatterns : [ 'pnpm-lock.yaml' ] ,
2124 getCacheFolderCommand : 'pnpm get store' ,
22- defaultCacheFolder : '~/ .pnpm-store'
25+ defaultCacheFolder : path . join ( os . homedir ( ) , ' .pnpm-store')
2326 } ,
2427 yarn1 : {
2528 lockFilePatterns : [ 'yarn.lock' ] ,
@@ -95,5 +98,11 @@ export const getCacheDirectoryPath = async (
9598
9699 core . debug ( `${ packageManager } path is ${ stdOut } ` ) ;
97100
101+ if ( ! fs . existsSync ( stdOut ) ) {
102+ throw new Error (
103+ `Cache folder path is retrieved for ${ packageManager } but doesn't exist on disk: ${ stdOut } `
104+ ) ;
105+ }
106+
98107 return stdOut ;
99108} ;
You can’t perform that action at this time.
0 commit comments