1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 04:33:53 +00:00

Added update script

This commit is contained in:
Henry Fredrick Schreiner 2017-02-03 15:43:08 -05:00
parent 5af4d9c36d
commit 200072dc38
3 changed files with 36 additions and 30 deletions

View File

@ -1,3 +1,6 @@
# Distributed under the OSI-approved MIT License. See accompanying
# file LICENSE or https://github.com/Crascit/DownloadProject for details.
cmake_minimum_required(VERSION 2.8.2) cmake_minimum_required(VERSION 2.8.2)
project(${DL_ARGS_PROJ}-download NONE) project(${DL_ARGS_PROJ}-download NONE)

View File

@ -1,3 +1,6 @@
# Distributed under the OSI-approved MIT License. See accompanying
# file LICENSE or https://github.com/Crascit/DownloadProject for details.
#
# MODULE: DownloadProject # MODULE: DownloadProject
# #
# PROVIDES: # PROVIDES:
@ -73,7 +76,7 @@
# #
# EXAMPLE USAGE: # EXAMPLE USAGE:
# #
# include(DownloadProject.cmake) # include(DownloadProject)
# download_project(PROJ googletest # download_project(PROJ googletest
# GIT_REPOSITORY https://github.com/google/googletest.git # GIT_REPOSITORY https://github.com/google/googletest.git
# GIT_TAG master # GIT_TAG master
@ -83,35 +86,6 @@
# #
# add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) # add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
# #
#
# SOURCE:
#
# https://github.com/Crascit/DownloadProject
#
# LICENSE:
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Crascit
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
#======================================================================================== #========================================================================================

29
scripts/UpdateDownloadProj.py Executable file
View File

@ -0,0 +1,29 @@
#!/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()