Skip to content

Commit 24e669f

Browse files
committed
Add dedicated scripts for restore
Proposing we add these. It's part of my workflow to do a restore before opening VS because I always disable package restore inside VS. Any objections?
1 parent ca593c8 commit 24e669f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

restore.cmd

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore %*"
3+
exit /b %ErrorLevel%

restore.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
source="${BASH_SOURCE[0]}"
4+
5+
# resolve $SOURCE until the file is no longer a symlink
6+
while [[ -h $source ]]; do
7+
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
8+
source="$(readlink "$source")"
9+
10+
# if $source was a relative symlink, we need to resolve it relative to the path where the
11+
# symlink file was located
12+
[[ $source != /* ]] && source="$scriptroot/$source"
13+
done
14+
15+
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
16+
"$scriptroot/eng/common/build.sh" --restore $@

0 commit comments

Comments
 (0)