icehrm-update
v1.0.3
Published
CLI tool to update IceHrm installations to the latest version
Readme
icehrm-update
CLI tool and Node.js module to update IceHrm installations to the latest version.
Installation
Global Installation (Recommended for CLI usage)
npm install -g icehrm-updateLocal Installation (For programmatic usage)
npm install icehrm-updateCLI Usage
Navigate to your IceHrm installation directory and run:
icehrm-updateOr specify the path to your IceHrm installation:
icehrm-update /path/to/icehrmOptions
| Option | Description |
|--------|-------------|
| --skip-backup | Skip creating a backup before update |
| --keep-download | Keep the downloaded zip file after update |
| --url <url> | Use a custom download URL for the update |
| -y, --yes | Skip confirmation prompt |
| -V, --version | Display version number |
| -h, --help | Display help |
Examples
# Update current directory
icehrm-update
# Update specific path
icehrm-update /var/www/icehrm
# Update without confirmation
icehrm-update -y
# Update without creating backup
icehrm-update --skip-backup
# Update from custom URL
icehrm-update --url https://example.com/icehrm-update.zipProgrammatic Usage
const { IceHrmUpdater, update } = require('icehrm-update');
// Quick update
async function quickUpdate() {
try {
const result = await update('/path/to/icehrm');
console.log('Updated from', result.previousVersion, 'to', result.newVersion);
} catch (error) {
console.error('Update failed:', error.message);
}
}
// Advanced usage with callbacks
async function advancedUpdate() {
const updater = new IceHrmUpdater('/path/to/icehrm', {
skipBackup: false,
keepDownload: false,
});
try {
const result = await updater.update({
onStep: (step) => console.log(step),
onProgress: (percent) => console.log(`Download: ${percent}%`),
onComplete: (result) => console.log('Complete!', result),
onError: (error) => console.error('Error:', error),
});
} catch (error) {
console.error('Update failed:', error.message);
}
}What Gets Updated
The updater performs the following operations:
Directories Merged (new/updated files copied)
app/core/docs/release-notes/web/
Extensions Replaced
extensions/editor/extensions/marketplace/
Root Files Copied
Dockerfile,Dockerfile-prod,Dockerfile-testing,Dockerfile-workerdocker-compose.yaml,docker-compose-prod.yaml,docker-compose-testing.yamlreadme.md,release.md,RoboFile.php,version.json
Backup
By default, a backup is created before updating. The backup includes:
core/docs/release-notes/extensions/editor/extensions/marketplace/
Backups are stored in app/data/updates/backups/.
Requirements
- Node.js >= 14.0.0
- Write permissions to the IceHrm installation directory
License
MIT
Support
For issues and support, visit: https://github.com/galonamedia/icehrm
