-
-
Notifications
You must be signed in to change notification settings - Fork 58
Fix/watcher spelling and path logic #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,6 +131,9 @@ func NewImportCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command | |
| } | ||
| } | ||
|
|
||
| // Normalize file path to keep upload and watch config paths consistent. | ||
| f = strings.TrimPrefix(f, "./") | ||
|
|
||
| // Try uploading this artifact. | ||
| msg, err := mc.UploadArtifact(f, mainArtifact) | ||
| if err != nil { | ||
|
|
@@ -154,11 +157,6 @@ func NewImportCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command | |
| watchCfg = &config.WatchConfig{} | ||
| } | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the renames @Ansita20, those parts look good. seems you deleted the normalization block entirely: -if strings.HasPrefix(f, "./") {
- f = strings.TrimPrefix(f, "./")
-}
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes sir I just saw that...there was some issues with the code so I had to remove it but forgot to fix and add it agian. |
||
| // Normalize file path to match the watcher fsnotify events format. | ||
| if strings.HasPrefix(f, "./") { | ||
| f = strings.TrimPrefix(f, "./") | ||
| } | ||
|
|
||
| // Upsert entry. | ||
| watchCfg.UpsertEntry(config.WatchEntry{ | ||
| FilePath: f, | ||
|
|
@@ -177,7 +175,7 @@ func NewImportCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command | |
| watchFile, err := config.DefaultLocalWatchPath() | ||
| errors.CheckError(err) | ||
|
|
||
| wm, err := watcher.NewWatchManger(watchFile) | ||
| wm, err := watcher.NewWatchManager(watchFile) | ||
| errors.CheckError(err) | ||
|
|
||
| fmt.Println("Watch mode enabled - microcks-watcher started...") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.