Skip to content

Commit a94282c

Browse files
committed
Don't try to deploy nonexistent files
1 parent 3e03ee0 commit a94282c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.go

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"bytes"
5+
"errors"
56
"fmt"
67
"html/template"
78
"os"
@@ -340,6 +341,11 @@ func logDeployFiles(files []deployment.DeployableItem, logger loggerV2.Logger) {
340341
func clearDeployFiles(filesToDeploy []string, logger loggerV2.Logger) []string {
341342
var clearedFilesToDeploy []string
342343
for _, pth := range filesToDeploy {
344+
_, err := os.Stat(pth)
345+
if err != nil && errors.Is(err, os.ErrNotExist) {
346+
logger.Warnf("file not found, skipping: %s", pth)
347+
continue
348+
}
343349
for _, fileBaseNameToSkip := range fileBaseNamesToSkip {
344350
if filepath.Base(pth) == fileBaseNameToSkip {
345351
logger.Warnf("skipping: %s", pth)

0 commit comments

Comments
 (0)