Skip to content

Commit 1bcab61

Browse files
committed
refactor: set node_modules to defualt ignore
1 parent fe5c670 commit 1bcab61

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cmd/deploy.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ var deployCmd = &cobra.Command{
121121
}
122122

123123
if deploymentCtx.Type == "unknown" {
124+
log.S.StopFail()
124125
log.Warning("unknown project type, please check your project directory. " +
125126
"or you could specify project type with `-t` flag")
126127
return
@@ -304,7 +305,9 @@ var deployCmd = &cobra.Command{
304305
// respect .gitignore and .letignore
305306
if _, err := os.Stat(filepath.Join(dirPath, ".gitignore")); err == nil {
306307
// match a file against a particular .gitignore
307-
i, _ := ignore.CompileIgnoreFile(filepath.Join(dirPath, ".gitignore"))
308+
i, _ := ignore.CompileIgnoreFileAndLines(filepath.Join(dirPath, ".gitignore"),
309+
"node_modules", // nodejs
310+
)
308311

309312
tmp := []string{}
310313
for _, v := range names {

cmd/dev.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ var devCmd = &cobra.Command{
6767
var deploymentCtx deploy.DeployContext
6868
detectedType := deploymentCtx.DetectProjectType()
6969
if detectedType == "unknown" {
70+
log.S.StopFail()
7071
log.Warning("unknown project type, please check your project directory. " +
7172
"or you could specify project type with `-t` flag")
7273
return

0 commit comments

Comments
 (0)