File: update-modules.sh

package info (click to toggle)
freespace2 25.0.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 47,232 kB
  • sloc: cpp: 657,500; ansic: 22,305; sh: 293; python: 200; makefile: 198; xml: 181
file content (24 lines) | stat: -rwxr-xr-x 853 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
# Copyright 2020, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
# update-modules.sh - iterates through all files in the cmake-modules repo,
# and copies them to the target directory if they already exist there.
#
# Run to update any CMake modules from the rpavlik/cmake-modules repo.
# You can either pass the target directory, or have the target directory as your current directory.
set -e
MODULES_DIR=$(cd $(dirname $0) && pwd)

(
    if [ "x$1" != "x" ]; then
        cd "$1"
    fi
    
    # Look through nearly every file in the cmake-modules repo, but don't copy this file to your project!
    (cd $MODULES_DIR && git ls-files | grep -v "update-modules") | while read -r relative; do
        if [ -f "${relative}" ]; then
            echo "${relative}"
            cp "${MODULES_DIR}/${relative}" .
        fi
    done
)