Skip to content

Commit

Permalink
Add feature to check for uncommitted changes and commit them
Browse files Browse the repository at this point in the history
  • Loading branch information
AkhileshNS committed Oct 20, 2020
1 parent f2221fc commit f5c1f3b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ const addConfig = ({ app_name, env_file, appdir }) => {
}
};

const createProcfile = ({ procfile, appdir, email }) => {
const createProcfile = ({ procfile, appdir }) => {
if (procfile) {
fs.writeFileSync(path.join(appdir, "Procfile"), procfile);
execSync(`git config user.name "Heroku-Deploy"`);
execSync(`git config user.email "${email}"`);
execSync(`git add -A && git commit -m "Added Procfile"`);
console.log("Written Procfile with custom configuration");
}
Expand Down Expand Up @@ -156,6 +154,15 @@ if (heroku.dockerBuildArgs) {
(async () => {
// Program logic
try {
execSync(`git config user.name "Heroku-Deploy"`);
execSync(`git config user.email "${heroku.email}"`);
const status = execSync("git status --porcelain").toString().trim();
if (status) {
execSync(
'git add -A && git commit -m "Commited changes from previous actions"'
);
}

// Check if using Docker
if (!heroku.usedocker) {
// Check if Repo clone is shallow
Expand Down

0 comments on commit f5c1f3b

Please sign in to comment.