-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrefresh.sh
More file actions
executable file
·113 lines (74 loc) · 3.04 KB
/
refresh.sh
File metadata and controls
executable file
·113 lines (74 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
#
# Ubuntu/Linux equivalent of dev.bat
#
# Usage:
# chmod +x refresh.sh
# ./refresh.sh
#
# This script downloads the specs/ folders from specific branches of the
# Microsoft WindowsAppSDK repository into corresponding local directories.
set -e
REPO="https://github.com/microsoft/WindowsAppSDK.git"
WORKDIR="$(pwd)"
BRANCHES="release/1.7-stable release/1.8-stable release/2.0-stable"
RESOURCE_WINAPPSDK_SPECS_DIR="WindowsAppSDK-specs"
mkdir -p "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR" && cd "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR" || { echo "Failed to enter the $RESOURCE_WINAPPSDK_SPECS_DIR directory"; exit 1; }
for BRANCH in $BRANCHES; do
FOLDER=$(basename "$BRANCH")
echo "Processing branch $BRANCH..."
rm -rf "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR/$FOLDER"
mkdir -p "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR/$FOLDER"
cd "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR/$FOLDER"
git init
git remote add origin "$REPO"
git config core.sparseCheckout true
echo "specs/" > .git/info/sparse-checkout
git fetch --depth 1 origin "$BRANCH"
git checkout "$BRANCH" # pwd at windowsappsdk-specs/1.7-stable
rm -rf .git
mv ./specs/* ./
done
echo "All specs folders have been downloaded."
cd "$WORKDIR"
REPO="https://github.com/microsoft/WindowsAppSDK-Samples.git"
BRANCHES="main release/1.7-stable release/1.8-stable release/2.0-stable"
RESOURCE_WINAPPSDK_SPECS_DIR="WindowsAppSDK-Samples"
mkdir -p "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR" && cd "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR" || { echo "Failed to enter the $RESOURCE_WINAPPSDK_SPECS_DIR directory"; exit 1; }
for BRANCH in $BRANCHES; do
FOLDER=$(basename "$BRANCH")
echo "Processing branch $BRANCH..."
rm -rf "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR/$FOLDER"
mkdir -p "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR/$FOLDER"
cd "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR/$FOLDER"
git init
git remote add origin "$REPO"
git config core.sparseCheckout true
echo "Samples/" > .git/info/sparse-checkout
git fetch --depth 1 origin "$BRANCH"
git checkout "$BRANCH"
rm -rf .git
mv ./Samples/* ./
done
echo "All Samples folders have been downloaded."
cd "$WORKDIR"
REPO="https://github.com/MicrosoftDocs/windows-ai-docs.git"
BRANCHES="docs"
RESOURCE_WINAPPSDK_SPECS_DIR="Windows-AI-Docs"
mkdir -p "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR" && cd "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR" || { echo "Failed to enter the $RESOURCE_WINAPPSDK_SPECS_DIR directory"; exit 1; }
for BRANCH in $BRANCHES; do
FOLDER=$(basename "$BRANCH")
echo "Processing branch $BRANCH..."
rm -rf "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR/$FOLDER"
mkdir -p "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR/$FOLDER"
cd "$WORKDIR/$RESOURCE_WINAPPSDK_SPECS_DIR/$FOLDER"
git init
git remote add origin "$REPO"
git config core.sparseCheckout true
echo "docs/" > .git/info/sparse-checkout
git fetch --depth 1 origin "$BRANCH"
git checkout "$BRANCH"
rm -rf .git
mv ./docs/* ./
done
echo "All ai docs have been downloaded."