Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions scripts/personal-install-relaunch-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,15 @@ relaunch_t3() {
sleep 0.25
continue
fi
if osascript >/dev/null 2>&1 <<'APPLESCRIPT'
tell application "System Events"
if not (exists process "MT Code") then error "no process"
end tell
# A fresh PID is the proof the relaunch worked. The AppleScript below
# only brings the window forward, and it needs an Automation grant the
# installing shell may not have — gating success on it reported a
# perfectly good install as "no fresh MT Code process after open".
osascript >/dev/null 2>&1 <<'APPLESCRIPT' || true
tell application "MT Code" to activate
APPLESCRIPT
then
echo "MAC_GUI_VISIBLE $APP_PATH pid=$pid"
return 0
fi
echo "MAC_GUI_VISIBLE $APP_PATH pid=$pid"
return 0
fi
sleep 0.25
done
Expand Down
28 changes: 26 additions & 2 deletions scripts/personal-refresh-win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,36 @@ function Log($msg) {
Log "refresh start"
Log ("args DesktopVersion=$DesktopVersion ForceRebuild=$ForceRebuild envVersion=$($env:T3CODE_DESKTOP_VERSION) envForce=$($env:T3_FORCE_REBUILD)")

$productRepoUrl = "https://github.com/munimtechnologies/mtcode.git"
if (-not (Test-Path $repo)) {
git clone --branch main --single-branch https://github.com/munimtechnologies/mtcode.git $repo
git clone --branch main --single-branch $productRepoUrl $repo
}
Set-Location $repo

# A checkout made before the repo moved still points at the old remote, where
# "main" does not resolve. Left alone, the fetch fails, rev-parse errors, and
# the build silently ships whatever commit this machine happened to be sitting
# on - which is how Blade and Dell ended up a day behind while reporting the
# new version number.
$currentRemote = (git remote get-url origin 2>$null)
if ($LASTEXITCODE -ne 0) {
git remote add origin $productRepoUrl
} elseif ($currentRemote.Trim() -ne $productRepoUrl) {
Log "origin was $currentRemote - repointing at $productRepoUrl"
git remote set-url origin $productRepoUrl
}

git fetch origin main
$new = (git rev-parse origin/main).Trim()
if ($LASTEXITCODE -ne 0) {
Log "fetch from origin failed - refusing to build a stale checkout"
exit 1
}
$new = (git rev-parse origin/main 2>$null)
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($new)) {
Log "origin/main did not resolve - refusing to build a stale checkout"
exit 1
}
$new = $new.Trim()
$old = ""
if (Test-Path $stateFile) {
$old = (Get-Content $stateFile -Raw).Trim()
Expand Down
Loading