File tree 1 file changed +10
-1
lines changed 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
import * as core from '@actions/core' ;
2
2
import * as exec from '@actions/exec' ;
3
+ import fs from 'fs' ;
4
+ import os from 'os' ;
5
+ import path from 'path' ;
3
6
4
7
type SupportedPackageManagers = {
5
8
[ prop : string ] : PackageManagerInfo ;
@@ -19,7 +22,7 @@ export const supportedPackageManagers: SupportedPackageManagers = {
19
22
pnpm : {
20
23
lockFilePatterns : [ 'pnpm-lock.yaml' ] ,
21
24
getCacheFolderCommand : 'pnpm get store' ,
22
- defaultCacheFolder : '~/ .pnpm-store'
25
+ defaultCacheFolder : path . join ( os . homedir ( ) , ' .pnpm-store')
23
26
} ,
24
27
yarn1 : {
25
28
lockFilePatterns : [ 'yarn.lock' ] ,
@@ -95,5 +98,11 @@ export const getCacheDirectoryPath = async (
95
98
96
99
core . debug ( `${ packageManager } path is ${ stdOut } ` ) ;
97
100
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
+
98
107
return stdOut ;
99
108
} ;
You can’t perform that action at this time.
0 commit comments