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

[Feature] Use .json config file for arguments #11

Closed
wants to merge 38 commits into from

Conversation

PyaeHlianMoe
Copy link
Member

pull request for #3.
Don't merge to master. Will need to test first.

@m3yevn m3yevn linked an issue Jul 13, 2020 that may be closed by this pull request
1 task
logInfo("Committing for " + amount + " times");
logInfo("Do not terminate this process!");

const hasContributors = CheckIfArgIncludes("--contributors");
Copy link
Member

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";
Copy link
Member

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

@m3yevn m3yevn closed this Jun 23, 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.

[Feature] Use .json config file for arguments
3 participants