SPB Git

Repository Public

textkit-build.sh 2.4 KB 54 lines shellscript

1#!/bin/zsh2# =============================================================================3#                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project          : SP Drive8# File             : scripts/textkit-build.sh9# Module           : scripts10# Repository       : https://git.spboucher.ai/sp-drive11# Project Website  : https://drive.spboucher.ai12# Created          : 2026-11-1913# Last Modified    : 2026-11-1914#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: support@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# Compile the local text-extraction helper (infra/textkit/main.swift → dist/spd-textkit). Idempotent; needs only the42# Command Line Tools (/usr/bin/swiftc). Run on the node from the app directory, after every change to the Swift source.43# Without the binary the API still works: content indexing is limited to text and Office families and reports it.44set -euo pipefail45cd "$(dirname "$0")/.."46SRC=infra/textkit/main.swift47OUT=${1:-dist/spd-textkit}48[[ -x /usr/bin/swiftc ]] || { echo "textkit: /usr/bin/swiftc missing (xcode-select --install) — OCR and PDF text extraction stay off"; exit 0; }49mkdir -p "$(dirname "$OUT")"50if [[ -x "$OUT" && "$OUT" -nt "$SRC" ]]; then echo "textkit: up to date ($OUT)"; exit 0; fi51/usr/bin/swiftc -O -swift-version 5 -o "$OUT.tmp" "$SRC"52mv "$OUT.tmp" "$OUT"53"$OUT" probe >/dev/null && echo "textkit: built $OUT"54
Files main
Menu

Theme