SPB Git

Repository Public

rollback.sh 2.3 KB 52 lines shellscript

1#!/bin/bash2# =============================================================================3#                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project          : MacLustr Vision8# File             : scripts/rollback.sh9# Module           : scripts10# Repository       : https://git.spboucher.ai/maclustr-vision11# Project Website  : https://camera.spboucher.ai12# Created          : 2026-11-3013# Last Modified    : 2026-11-3014#15# Author           : Simon-Pierre Boucher16# Position         : Professor of Finance17# Institution      : Université du Québec en Outaouais (UQO)18# Organization     : SP Boucher19# Website          : https://spboucher.ai20# Git              : https://git.spboucher.ai21#22# Preferred Contact: admin@spboucher.ai23# Technical Contact: dev@spboucher.ai24# Security/Admin   : admin@spboucher.ai25#26# Copyright (c) 202627# Simon-Pierre Boucher28# All rights reserved where applicable. This file is governed by the29# applicable project license, copyright notices and relevant law.30# Existing third-party rights and notices remain unaffected.31#32# License          : None specified (no license file in this repository)33#34# Do not embed credentials, private keys, access tokens,35# certificates or confidential personal information.36#37# =============================================================================38# END OF SP BOUCHER SOURCE HEADER39# =============================================================================4041# Retour arrière du code vers un commit précédent (par défaut : le précédent), rebuild, relance.42# Les données (~/vision) et les secrets (~/.config/maclustr-vision) ne sont pas touchés.43source "$(dirname "$0")/common.sh"44TARGET="${1:-HEAD~1}"45git diff --quiet && git diff --cached --quiet || { echo "ERREUR : modifications non commitées dans $APP_DIR"; exit 1; }46PREV="$(git rev-parse --short HEAD)"47git checkout --quiet "$(git rev-parse "$TARGET")" -- . 48"$(dirname "$0")/setup.sh"49pm2 restart "$PM2_CORE" "$PM2_API" >/dev/null50echo "code ramené à $(git rev-parse --short "$TARGET") (HEAD reste $PREV : commiter ce retour arrière ou 'git checkout HEAD -- .' pour l'annuler)"51sleep 3; "$(dirname "$0")/status.sh"52
Files main
Menu

Theme