Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulCatalinas committed Dec 5, 2024
2 parents e26665a + 6b744b7 commit 9cf62b3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
1 change: 0 additions & 1 deletion internal/enums/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const (
const (
JsonUnmarshalError ProcessError = "JsonUnmarshal"
JsonMarshalError ProcessError = "JsonMarshal"
GetWorkingDirectoryError ProcessError = "GetWorkingDirectory"
InvalidTypeForFilesToAddError ProcessError = "InvalidTypeForFilesToAdd"
DependenciesError ProcessError = "Dependencies"
GitHubRepoOpenError ProcessError = "GitHubRepoOpen"
Expand Down
8 changes: 3 additions & 5 deletions internal/error_messages/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ package error_messages
import "github.com/RaulCatalinas/HuskyBC/internal/enums"

var PROCESS_ERROR_MESSAGES = map[enums.ProcessError]string{
enums.JsonUnmarshalError: "Replace this with an error message that's descriptive and easily understandable by any developer.",
enums.JsonUnmarshalError: generateErrorMessage("unmarshalling JSON data"),

enums.JsonMarshalError: "Replace this with an error message that's descriptive and easily understandable by any developer.",
enums.JsonMarshalError: generateErrorMessage("marshalling JSON data with indentation"),

enums.GetWorkingDirectoryError: "Replace this with an error message that's descriptive and easily understandable by any developer.",

enums.InvalidTypeForFilesToAddError: "Replace this with an error message that's descriptive and easily understandable by any developer.",
enums.InvalidTypeForFilesToAddError: generateErrorMessage("adding files to .npmignore with an invalid type"),

enums.DependenciesError: generateErrorMessage("installing dependencies"),

Expand Down
11 changes: 0 additions & 11 deletions internal/utils/npm.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,6 @@ func modifyNpmIgnore(filesToAdd interface{}) {
Message: "Writing in the file \".npmignore\"...",
})

_, err := os.Getwd()

if err != nil {
WriteMessage(WriteMessageProps{
Type: enums.MessageTypeError,
Message: errorMessages.PROCESS_ERROR_MESSAGES[enums.GetWorkingDirectoryError],
})

os.Exit(1)
}

CreateFolderOrFileIfNotExists(constants.PATH_DIR_NPMIGNORE, false)

data := readFile(constants.PATH_DIR_NPMIGNORE)
Expand Down

0 comments on commit 9cf62b3

Please sign in to comment.