Add PowerShell and sh scripts to clone/update content directory
parent
a5ea219b27
commit
22291cd795
|
@ -0,0 +1,19 @@
|
||||||
|
$ScriptDir = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||||
|
$ScriptDir = Split-Path $ScriptDir -Parent
|
||||||
|
Push-Location $ScriptDir
|
||||||
|
if (-not (Test-Path "content"))
|
||||||
|
{
|
||||||
|
git clone --depth 1 "https://github.com/CelestiaProject/CelestiaContent.git" -b master "content"
|
||||||
|
}
|
||||||
|
elseif (Test-Path "content" -PathType Container)
|
||||||
|
{
|
||||||
|
Set-Location content
|
||||||
|
git fetch --depth 1 origin master
|
||||||
|
git reset --hard origin/master
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Error "content exists and is not a directory"
|
||||||
|
}
|
||||||
|
|
||||||
|
Pop-Location
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
scripthome=$(dirname "$0" | while read a; do cd "$a" && pwd && break; done)
|
||||||
|
oldpath=$(pwd)
|
||||||
|
cd "$scripthome/.."
|
||||||
|
|
||||||
|
if [ ! -e "content" ]
|
||||||
|
then
|
||||||
|
git clone --depth 1 "https://github.com/CelestiaProject/CelestiaContent.git" -b master content
|
||||||
|
elif [ -d "content" ]
|
||||||
|
then
|
||||||
|
cd content
|
||||||
|
git fetch --depth 1 origin master
|
||||||
|
git reset --hard origin/master
|
||||||
|
else
|
||||||
|
>&2 echo "content exists and is not a directory"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$oldpath"
|
Loading…
Reference in New Issue