Add PowerShell and sh scripts to clone/update content directory

pull/1270/head
Andrew Tribick 2021-12-28 15:22:11 +01:00 committed by ajtribick
parent a5ea219b27
commit 22291cd795
2 changed files with 38 additions and 0 deletions

View File

@ -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

View File

@ -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"