-
Notifications
You must be signed in to change notification settings - Fork 157
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
Add MUTAGEN_PROJECT_FILE env variable #203
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package project | ||
|
||
import "os" | ||
|
||
const ( | ||
// DefaultConfigurationFileName is the name of the Mutagen project | ||
// configuration file. | ||
|
@@ -8,3 +10,11 @@ const ( | |
// order to compute the corresponding lock file. | ||
LockFileExtension = ".lock" | ||
) | ||
|
||
func ConfigurationFileName() string { | ||
fileName := os.Getenv("MUTAGEN_PROJECT_FILE") | ||
if fileName == "" { | ||
return DefaultConfigurationFileName | ||
} | ||
return fileName | ||
} | ||
Comment on lines
+14
to
+20
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. This code looks like it needs to be
(assuming you're in the root of the source directory). This is one of those weird Go things, but basically Go's canonical style is "whatever the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the
MUTAGEN_PROJECT_FILE
environment variable allows a path to be specified (as opposed to just a filename), then I think the sameos.Chdir
logic used for a project file specified on the command line will be needed to support relative synchronization paths. This applies at least in thestart
command, but I think in the other commands as well.