-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Feature] Use .json config file for arguments #11
Conversation
logInfo("Committing for " + amount + " times"); | ||
logInfo("Do not terminate this process!"); | ||
|
||
const hasContributors = CheckIfArgIncludes("--contributors"); |
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.
arguments should be remained also, if there is no config file, argument is used.
import { writeFileSync, existsSync } from "fs"; | ||
import { LoadService } from "../OtherServices/LoadService"; | ||
import { commitGen } from "../../config/gitlestial.config"; |
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.
my meaning is not importing the config file, but more like reading it from the directory on which user is running gitlestial command,
e.g,
test_app has gitlestial.config.js in the root directory.
so we can
$ cd test_app
$ gitlestial commit-gen
it will trigger the same as
$ gitlestial commit-gen --amount 100 --contributors [email protected],[email protected] -am "just a test"
if the gitlestial.config.js has
module.exports = {
commitGen: {
amount: 100,
contributors: ["[email protected]","[email protected]"],
message: "just a test",
},
};
it's not a static import but a dynamic reading of a config file
pull request for #3.
Don't merge to master. Will need to test first.