forked from micro-manager/mmCoreAndDevices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
secret-device-adapters-checkout.sh
executable file
·40 lines (33 loc) · 1.11 KB
/
secret-device-adapters-checkout.sh
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
#!/bin/bash
# For use by Micro-Manager team members and continuous integration scripts
# only: run this script to clone (if necessary) and check out the matching
# commit of SecretDeviceAdapters.
#
# The SecretDeviceAdapters working tree is simply placed at the root of the
# mmCoreAndDevices working tree, _not_ as a submodule.
#
# If there is an existing clone of SecretDeviceAdapters, it is used regardless
# of its settings and which remote it points to.
set -e
if [ ! -f secret-device-adapters-commit ]; then
echo The secret-device-adapters-commit file is missing.
exit 1
fi
repo_root=$(dirname "$0")
pushd "$repo_root" >/dev/null
sda_sha=$(cat secret-device-adapters-commit)
if [ -d ./SecretDeviceAdapters ]; then
echo Using existing SecretDeviceAdapters working tree
else
if [ "$1" = "use_ssh" ]; then
echo Cloning via SSH...
git clone [email protected]:micro-manager/SecretDeviceAdapters.git
else
echo Cloning via HTTPS...
git clone https://github.com/micro-manager/SecretDeviceAdapters.git
fi
fi
cd SecretDeviceAdapters
git fetch
git checkout $sda_sha
popd >/dev/null