Skip to content

Commit

Permalink
Merge pull request #23 from sjultra/dev-1
Browse files Browse the repository at this point in the history
 add descriptive commit messages to automatic commmit and pull script
  • Loading branch information
Dayvvo authored Aug 15, 2023
2 parents 081845b + 5f8abff commit 02c3ac8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pre-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const readLine = require('readline');
const maybePluralize = (count, noun, suffix = "s") => `${noun}${count !== 1 ? suffix : ""}`;

async function main( ){

try{
const status = await git.status();
const {files} = status;
Expand Down Expand Up @@ -56,28 +57,29 @@ async function main( ){
// console.log('catching errors in commitpull',err)

}



}

// if there are changes yet to be commited, execute code block below
if (stagingArr.length){
// create empty user input

//initialize user input in terminal
const rl = readLine.createInterface({
input: process.stdin,
output: process.stdout,
});


// display message that tells user to enter commit message
rl.question("You have untracked changes. Please add a commit message\n",(string)=>{

// input is collected in the parameter (string) in the line above and used to trigger the function that commits and pulls
commitAndPull(string)
rl.close();

rl.close();
}

)
// close input stream
}
else {
//pull without committing via the commitandPull function below
commitAndPull()
}
}
Expand Down

0 comments on commit 02c3ac8

Please sign in to comment.