This repository has been archived on 2025-09-07. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
dotnet-installer/scripts/common/_nuget.sh
Eric Erhardt 617af759ae Cache NuGet packages on our CI server between builds.
Currently on our CI builds, we point our NuGet cache under the repo. In between builds the repo gets deleted, thus the cache is lost.

This change moves the cache to %userprofile%\.nuget\packages on CI and dev boxes.  On CI, we expire the cache after a day by default.
2016-02-05 10:34:20 -06:00

18 lines
545 B
Bash

#!/usr/bin/env bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
export NUGET_PACKAGES=~/.nuget/packages
export DOTNET_PACKAGES=$NUGET_PACKAGES
export DNX_PACKAGES=$NUGET_PACKAGES
if [ ! -d $NUGET_PACKAGES ]; then
mkdir -p $NUGET_PACKAGES
fi
if [ -z "$NUGET_PACKAGES_CACHE_TIME_LIMIT" ]; then
# default the package cache expiration to 1 week, in hours
export NUGET_PACKAGES_CACHE_TIME_LIMIT=$(( 7 * 24 ))
fi