Skip to content

Commit

Permalink
refactor: set node_modules to defualt ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
fredliang44 committed May 24, 2022
1 parent fe5c670 commit 1bcab61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ var deployCmd = &cobra.Command{
}

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

tmp := []string{}
for _, v := range names {
Expand Down
1 change: 1 addition & 0 deletions cmd/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var devCmd = &cobra.Command{
var deploymentCtx deploy.DeployContext
detectedType := deploymentCtx.DetectProjectType()
if detectedType == "unknown" {
log.S.StopFail()
log.Warning("unknown project type, please check your project directory. " +
"or you could specify project type with `-t` flag")
return
Expand Down

0 comments on commit 1bcab61

Please sign in to comment.