scripts
¶New in version 6.0.
Optional | Type: Object
Execute custom scripts during the special Package Management CLI life cycle events:
Event |
Description |
---|---|
|
runs a script AFTER the package has been installed |
|
runs a script BEFORE the package is removed. |
Examples
Run a custom Python script located in the package “scripts” folder AFTER the package is installed. Please note that you don’t need to specify a Python interpreter for Python scripts.
"scripts": {
"postinstall": "scripts/after_install.py"
}
Run a custom Bash script BEFORE the package is uninstalled. The script is declared as a list of command arguments and is located at the root of a package:
"scripts": {
"preuninstall": ["maintainance.sh", "--action", "uninstall"]
}