File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,20 @@ function makeAbsolute(normalizedPath: string): string {
5959}
6060
6161function getOptions ( ) {
62+ var dirName : string ;
6263 if ( includeRootFolder ) {
63- tl . debug ( "cwd (include root folder)= " + path . dirname ( rootFolder ) ) ;
64- return { cwd : path . dirname ( rootFolder ) } ;
64+ dirName = path . dirname ( rootFolder ) ;
65+ tl . debug ( "cwd (include root folder)= " + dirName ) ;
66+ return { cwd : dirName } ;
6567 } else {
66- tl . debug ( "cwd (exclude root folder)= " + rootFolder ) ;
67- return { cwd : rootFolder } ;
68+ var stats : tl . FsStats = tl . stats ( rootFolder ) ;
69+ if ( stats . isFile ( ) ) {
70+ dirName = path . dirname ( rootFolder ) ;
71+ } else {
72+ dirName = rootFolder ;
73+ }
74+ tl . debug ( "cwd (exclude root folder)= " + dirName ) ;
75+ return { cwd : dirName } ;
6876 }
6977}
7078
@@ -260,8 +268,8 @@ function doWork() {
260268 if ( tl . exist ( archiveFile ) ) {
261269 if ( replaceExistingArchive ) {
262270 try {
263- var stats = tl . stats ( archiveFile ) ;
264- if ( stats . isFile ) {
271+ var stats : tl . FsStats = tl . stats ( archiveFile ) ;
272+ if ( stats . isFile ( ) ) {
265273 console . log ( 'removing existing archive file before creation: ' + archiveFile ) ;
266274 } else {
267275 failTask ( 'Specified archive file: ' + archiveFile + ' already exists and is not a file.' ) ;
You can’t perform that action at this time.
0 commit comments