mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-22 17:59:06 +08:00
parse the root Dir path
This commit is contained in:
parent
80d992795c
commit
9a01ddca95
@ -1,6 +1,6 @@
|
||||
import * as fs from 'fs'
|
||||
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'
|
||||
|
||||
export interface UploadSpecification {
|
||||
@ -22,7 +22,9 @@ export function getUploadSpecification(
|
||||
// artifact name was checked earlier on, no need to check again
|
||||
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`)
|
||||
}
|
||||
if (!fs.lstatSync(rootDirectory).isDirectory()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user