Skip to content
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

Use old config files if available closes #3083 #3084

Merged
merged 7 commits into from
Sep 2, 2015
Merged

Conversation

myleshorton
Copy link
Contributor

No description provided.

log.Errorf("Could not rename file: %v", err)
}
} else if path, exists := configExists("lantern-2.0.0+stable.yaml"); exists {
if err := os.Rename(path, cur); err == nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch thanks! I changed that at the last minute -- fixing now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@@ -73,9 +75,59 @@ type CA struct {
Cert string // PEM-encoded
}

func exists(file string) bool {
if _, err := os.Stat(file); os.IsNotExist(err) {
fmt.Printf("no such file or directory: %s", file)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing!

for _, file := range files {
if path, exists := configExists(file); exists {
if err := os.Rename(path, cur); err != nil {
log.Errorf("Could not rename file: %v", err)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah now with the loop that's a little easier. I did do that intentionally yeah just because we might be able to grab the next for some unknown reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change the log!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -112,7 +160,7 @@ func Init(version string) (*Config, error) {
return cfg.updateFrom(bytes)
}
} else {
log.Errorf("Nil bytes?")
log.Debugf("bytes is nil when the config is unmodified")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

fffw added a commit that referenced this pull request Sep 2, 2015
Use old config files if available closes #3083
@fffw fffw merged commit 62e6851 into release-2.0.1 Sep 2, 2015
@fffw fffw deleted the issue3083 branch September 2, 2015 05:05
@getlantern getlantern deleted a comment from myleshorton Mar 3, 2021
@getlantern getlantern deleted a comment from myleshorton Mar 3, 2021
@getlantern getlantern deleted a comment from fffw Mar 3, 2021
@getlantern getlantern deleted a comment from myleshorton Mar 3, 2021
@getlantern getlantern deleted a comment from fffw Mar 3, 2021
@getlantern getlantern deleted a comment from fffw Mar 3, 2021
@getlantern getlantern deleted a comment from fffw Mar 3, 2021
@getlantern getlantern deleted a comment from fffw Mar 3, 2021
@getlantern getlantern deleted a comment from fffw Mar 3, 2021
@getlantern getlantern deleted a comment from fffw Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants