Compare commits

..

2 Commits

Author SHA1 Message Date
Logan Cusano
c46b7c6ea6 Modified the self updater to reset any local changes when updating #10 2024-03-03 22:02:27 -05:00
Logan Cusano
5d2097ecd4 Updated gitignore with the op25 dir we will create 2024-03-03 22:02:00 -05:00
2 changed files with 11 additions and 0 deletions

2
.gitignore vendored
View File

@@ -297,3 +297,5 @@ cython_debug/
# Ignore the config dirs # Ignore the config dirs
config/ config/
# Ignore the OP25 directory we will create
op25/

View File

@@ -18,6 +18,15 @@ export const checkForUpdates = async () => {
if (latestCommitHash !== localCommitHash) { if (latestCommitHash !== localCommitHash) {
console.log('An update is available. Updating...'); console.log('An update is available. Updating...');
// Check if there have been any changes to the code
const gitStatus = await git.status()
console.log(gitStatus);
if (gitStatus.modified.length > 0){
// There is locally modified code
console.log("There is locally modified code, resetting...");
await git.reset('hard', ['origin/master'])
}
// Pull the latest changes from the remote repository // Pull the latest changes from the remote repository
await git.pull(); await git.pull();