1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 20:23:55 +00:00
CLI11/scripts/UpdateDownloadProj.py
Henry Fredrick Schreiner 200072dc38 Added update script
2017-02-03 15:43:08 -05:00

30 lines
804 B
Python
Executable File

#!/usr/bin/env python
from __future__ import print_function, division
from plumbum import local, cli, FG
FILES = [ 'https://raw.githubusercontent.com/Crascit/DownloadProject/master/DownloadProject.cmake',
'https://raw.githubusercontent.com/Crascit/DownloadProject/master/DownloadProject.CMakeLists.cmake.in']
DIR = local.path(__file__).dirname
def download_file(path):
try:
from plumbum.cmd import wget
wget[path] & FG
except ImportError:
from plumbum.cmd import curl
name = path.split('/')[-1]
(curl[path] > name) & FG
class UpdateDownloadProj(cli.Application):
def main(self):
with local.cwd(DIR / '../cmake'):
for f in FILES:
download_file(f)
if __name__ == "__main__":
UpdateDownloadProj()