Skip to content

Commit

Permalink
warning when the restic-binary was not found
Browse files Browse the repository at this point in the history
  • Loading branch information
creativeprojects committed Jun 22, 2021
1 parent 4686dd2 commit 823304a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion config/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func NewGlobal() *Global {
IONice: constants.DefaultIONiceFlag,
Nice: constants.DefaultStandardNiceFlag,
DefaultCommand: constants.DefaultCommand,
ResticBinary: constants.DefaultResticBinary,
ResticLockRetryAfter: constants.DefaultResticLockRetryAfter,
ResticStaleLockAge: constants.DefaultResticStaleLockAge,
MinMemory: constants.DefaultMinMemory,
Expand Down
1 change: 0 additions & 1 deletion config/global_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ something = 1
assert.Equal(t, constants.DefaultCommand, global.DefaultCommand)
assert.Equal(t, constants.DefaultIONiceFlag, global.IONice)
assert.Equal(t, constants.DefaultStandardNiceFlag, global.Nice)
assert.Equal(t, constants.DefaultResticBinary, global.ResticBinary)
assert.Equal(t, constants.DefaultResticLockRetryAfter, global.ResticLockRetryAfter)
assert.Equal(t, constants.DefaultResticStaleLockAge, global.ResticStaleLockAge)
assert.Equal(t, uint64(constants.DefaultMinMemory), global.MinMemory)
Expand Down
1 change: 0 additions & 1 deletion constants/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const (
DefaultConfigurationFile = "profiles"
DefaultProfileName = "default"
DefaultCommand = "snapshots"
DefaultResticBinary = "restic"
DefaultResticLockRetryAfter = 60 * time.Second
DefaultResticStaleLockAge = 2 * time.Hour
DefaultTheme = "light"
Expand Down
7 changes: 4 additions & 3 deletions filesearch/filesearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,14 @@ func findConfigurationFileWithExtension(configFile string) string {
func FindResticBinary(configLocation string) (string, error) {
if configLocation != "" {
// Start by the location from the configuration
configLocation, err := ShellExpand(configLocation)
filename, err := ShellExpand(configLocation)
if err != nil {
clog.Warning(err)
}
if configLocation != "" && fileExists(configLocation) {
return configLocation, nil
if filename != "" && fileExists(filename) {
return filename, nil
}
clog.Warningf("cannot find or read the restic binary specified in the configuration: %q", configLocation)
}
paths := getDefaultBinaryLocations()
binaryFile := getResticBinary()
Expand Down

0 comments on commit 823304a

Please sign in to comment.