1
0
Fork 0

parse the root Dir path

pull/1276/head
John Sudol 2022-12-19 17:01:27 +00:00 committed by GitHub
parent 80d992795c
commit 9a01ddca95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import * as fs from 'fs' import * as fs from 'fs'
import {debug} from '@actions/core' import {debug} from '@actions/core'
import {join, normalize, resolve} from 'path' import {join, normalize, resolve, parse} from 'path'
import {checkArtifactFilePath} from './path-and-artifact-name-validation' import {checkArtifactFilePath} from './path-and-artifact-name-validation'
export interface UploadSpecification { export interface UploadSpecification {
@ -22,7 +22,9 @@ export function getUploadSpecification(
// artifact name was checked earlier on, no need to check again // artifact name was checked earlier on, no need to check again
const specifications: UploadSpecification[] = [] const specifications: UploadSpecification[] = []
if (!fs.existsSync(rootDirectory)) { const rootPath = parse(rootDirectory).dir;
if (!fs.existsSync(rootPath)) {
throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`) throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`)
} }
if (!fs.lstatSync(rootDirectory).isDirectory()) { if (!fs.lstatSync(rootDirectory).isDirectory()) {