diff --git a/support/UpdateContent.ps1 b/support/UpdateContent.ps1 new file mode 100755 index 000000000..398b4b6a8 --- /dev/null +++ b/support/UpdateContent.ps1 @@ -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 diff --git a/support/updatecontent.sh b/support/updatecontent.sh new file mode 100755 index 000000000..7c8385449 --- /dev/null +++ b/support/updatecontent.sh @@ -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"