Skip to content

Latest commit

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Auto Git Update

a node.js module used for automatically updating projects from a git repository.

Notes

  • This is a ECMAScript module which makes use of import and export statements.
  • This module uses simple-logger (https://github.com/chegele/Logger).
  • To update from private repositories a personal access token needs to be provided.
  • During updates a backup of the old version is taken and stored in the configured tempLocation.
  • The remote package.json is compared to the local package.json to determine if a different version is available.

Options

  • repositoryString - The url to the root of a git repository to update from.
  • tempLocationString - The local dir to save temporary information for Auto Git Update.
  • fromReleasesBoolean - [optional] Updated based off of latest published GitHub release instead of branch package.json.
  • branchString - [optional] The branch to update from. Defaults to master.
  • tokenString - [optional] A personal access token used for accessions private repositories.
  • ignoreFilesArray[String] - [optional] An array of files to not install when updating. Useful for config files.
  • executeOnCompleteString - [optional] A command to execute after an update completes. Good for restarting the app.
  • exitOnCompleteBoolean - [optional] Use process exit to stop the app after a successful update.
  • logConfigObject - [optional] An object with the logging configuration, see https://github.com/chegele/Logger

Functions

  • autoUpdate() - Updates if local package.json version is different than remote.
  • compareVersions() - Compares package.json versions without updating.
    • Returns an object with the properties UpToDate, currentVersion, & remoteVersion.
  • forceUpdate() - Updates without comparing package versions.
  • setLogConfig(logConfig) - Updates logging configuration. https://github.com/chegele/Logger

Example

import AutoGitUpdate from 'auto-git-update';
const config = {
repository: 'https://github.com/chegele/BackupPurger',
tempLocation: 'C:/Users/scheg/Desktop/tmp/',
ignoreFiles: ['util/config.js'],
executeOnComplete: 'C:\\Users\\scheg\\Desktop\\worksapce\\AutoGitUpdate\\startTest.bat',
exitOnComplete: true,
packageManager: "npm"
}
const updater = new AutoGitUpdate(config);
updater.autoUpdate();

About

Update node application from git repo.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages