Last active
January 4, 2018 03:43
-
-
Save gnilchee/cd442678172b17b5a8a283ce1f3c4f40 to your computer and use it in GitHub Desktop.
simple invoke script to clean and update apt-get
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from invoke import task | |
@task | |
def clean(ctx): | |
print("Cleaning!") | |
ctx.run("sudo apt-get clean all") | |
print("Cleaning Done.") | |
@task | |
def update(ctx): | |
print("Starting Update") | |
ctx.run("sudo apt-get update") | |
print("Update Complete.") | |
@task(pre=[clean, update], post=[clean]) | |
def upgrade(ctx): | |
print("Starting Upgrade!") | |
ctx.run("sudo apt-get dist-upgrade -y") | |
print("Upgrade Complete.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output: