cemu-vcpkg/scripts/azure-pipelines/osx/initialize-environment.sh
Billy O'Neal 3b0080e3b0
[vcpkg] Harden file removals and clean directory contents in "CI" inside vcpkg itself. (#11432)
`files.h/files.cpp`:
* Add end and else comments to all macros.
* Add "remove_all_inside" function which empties a directory without actually deleting the directory. This is necessary to handle the case where the directory is actually a directory symlink.
* Change remove_all to use std::remove when VCPKG_USE_STD_FILESYSTEM is set; this will engage POSIX delete support available on current Win10.

`commands.ci.cpp`: empty "installed".

`*/initialize_environment.*`: No longer clean the directories outside the tool.

`ci-step.ps1`: Remove unused console output tee-ing.
2020-05-19 13:43:30 -07:00

24 lines
557 B
Bash
Executable File

#!/bin/bash
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# Sets up the environment for MacOS runs of vcpkg CI
mkdir -p ~/Data/installed || true
ln -s ~/Data/installed
mkdir -p ~/Data/buildtrees || true
ln -s ~/Data/buildtrees
mkdir -p ~/Data/packages || true
ln -s ~/Data/packages
rm archives || rm -rf archives || true
ln -s ~/Data/archives
mkdir -p ~/Data/downloads || true
ln -s ~/Data/downloads
#delete downloaded files that have not been used in 7 days
find downloads/ -maxdepth 1 -type f ! -atime 7 -exec rm -f {} \;