fix: 源頭就寫對的網址,不靠發佈時改寫(leo 2026-07-21)
leo:「要發佈的正稿,從頭就不要用奇怪的網址,以免改來改去。」 =sanitize 每次改寫是補丁不是解法。改成源頭正確: - README/README.en:死帳號 uncle6me-web → youlinhsieh(該帳號已 suspend, 安裝指令指著它半年沒人發現=別人照做必失敗) - install.sh/update.sh:來源預設改公開 GitHub raw;內部要指私有草稿源 走 TEMPLATE_SOURCE= 環境變數覆寫,不改檔 → 兩邊不再需要維護兩份網址 - tasks-project-sync.yaml 註解範例帳號改通用佔位符 sanitize 降級為「安全網」:正常情況應無需改寫;若它報告改了東西= 源頭又混進錯網址的信號,回頭修源頭。保留它做發佈前驗證(殘留即中止)—— 擋的是「只有外部使用者才會撞到、我們自己永遠測不到」的錯。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+3
-3
@@ -32,7 +32,7 @@ This template solves both problems with two systems:
|
|||||||
### Option 1: New project
|
### Option 1: New project
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/uncle6me-web/system-dev-template
|
git clone https://github.com/youlinhsieh/system-dev-template
|
||||||
cp -r system-dev-template/template/. your-new-project/
|
cp -r system-dev-template/template/. your-new-project/
|
||||||
cd your-new-project
|
cd your-new-project
|
||||||
```
|
```
|
||||||
@@ -46,7 +46,7 @@ Then in a CC conversation:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd your-existing-project
|
cd your-existing-project
|
||||||
curl -sSL https://raw.githubusercontent.com/uncle6me-web/system-dev-template/main/scripts/install.sh | bash
|
curl -sSL https://raw.githubusercontent.com/youlinhsieh/system-dev-template/main/scripts/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
The script only creates what's missing — **it never touches files you already have**.
|
The script only creates what's missing — **it never touches files you already have**.
|
||||||
@@ -80,7 +80,7 @@ Heard there are new features and want the latest? Just run this:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd your-project
|
cd your-project
|
||||||
curl -sSL https://raw.githubusercontent.com/uncle6me-web/system-dev-template/main/scripts/update.sh | bash
|
curl -sSL https://raw.githubusercontent.com/youlinhsieh/system-dev-template/main/scripts/update.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
It first compares your version with the latest, tells you **which new features you'd gain**, and then:
|
It first compares your version with the latest, tells you **which new features you'd gain**, and then:
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ CC 是個優秀的工程師,但不是個好的專案經理。它會猛衝完
|
|||||||
### 方式一:新專案
|
### 方式一:新專案
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/uncle6me-web/system-dev-template
|
git clone https://github.com/youlinhsieh/system-dev-template
|
||||||
cp -r system-dev-template/template/. your-new-project/
|
cp -r system-dev-template/template/. your-new-project/
|
||||||
cd your-new-project
|
cd your-new-project
|
||||||
```
|
```
|
||||||
@@ -45,7 +45,7 @@ cd your-new-project
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd your-existing-project
|
cd your-existing-project
|
||||||
curl -sSL https://raw.githubusercontent.com/uncle6me-web/system-dev-template/main/scripts/install.sh | bash
|
curl -sSL https://raw.githubusercontent.com/youlinhsieh/system-dev-template/main/scripts/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
腳本只建立缺少的東西,**已有的檔案一律不動**。
|
腳本只建立缺少的東西,**已有的檔案一律不動**。
|
||||||
@@ -79,7 +79,7 @@ CC 會掃描現有文件、建立 wiki、整理 docs 結構。
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd your-project
|
cd your-project
|
||||||
curl -sSL https://raw.githubusercontent.com/uncle6me-web/system-dev-template/main/scripts/update.sh | bash
|
curl -sSL https://raw.githubusercontent.com/youlinhsieh/system-dev-template/main/scripts/update.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
它會先比對你的版本和最新版,告訴你**多了哪些新功能**,然後:
|
它會先比對你的版本和最新版,告訴你**多了哪些新功能**,然後:
|
||||||
|
|||||||
@@ -3,15 +3,18 @@
|
|||||||
|
|
||||||
由 publish-github.sh 自動呼叫(步驟 3.5),參數=匯出樹的暫存目錄。
|
由 publish-github.sh 自動呼叫(步驟 3.5),參數=匯出樹的暫存目錄。
|
||||||
|
|
||||||
為什麼需要(leo 2026-07-21):
|
🔑 定位(leo 2026-07-21 校正):**這支是安全網,不是主要手段。**
|
||||||
「我不想給它 Gitea 網址,因為我們已經計劃要把 gitea 改用 CF 版本了。」
|
|
||||||
|
|
||||||
install.sh / update.sh 內建的抓取來源指向我們的 **private Gitea**:
|
leo:「要發佈的正稿,**從頭就不要用奇怪的網址,以免改來改去**。」
|
||||||
- 別人抓不到(private)→ 裝不起來
|
|
||||||
- 且該網址即將換成 CF 版 → 公開出去的網址馬上失效
|
|
||||||
|
|
||||||
→ 公開版一律改指 GitHub raw。私有工作區維持 Gitea 不動,
|
→ 已於同日**源頭修正**:install.sh/update.sh 的來源預設就是公開 GitHub raw
|
||||||
兩邊不必手工維護兩份(改寫發生在發佈當下)。
|
(內部要指私有草稿源時走 `TEMPLATE_SOURCE=` 環境變數覆寫,不改檔);
|
||||||
|
README 的死帳號 `uncle6me-web` 也直接改掉。
|
||||||
|
**正常情況下本腳本應該「無需改寫」** ——若它報告改了東西,代表源頭又混進錯網址,
|
||||||
|
那是要回頭修源頭的信號,不是「反正發佈時會自動改」。
|
||||||
|
|
||||||
|
保留它的理由=**發佈前的最後一道驗證**:任何殘留失效來源就 exit 1 中止,
|
||||||
|
避免「別人照著裝卻裝不起來」這種只有外部使用者才會撞到、我們自己永遠測不到的錯。
|
||||||
"""
|
"""
|
||||||
import pathlib
|
import pathlib
|
||||||
import re
|
import re
|
||||||
|
|||||||
+7
-3
@@ -26,9 +26,13 @@ t() { if [ "$IS_ZH" = "yes" ]; then printf '%s\n' "$1"; else printf '%s\n' "$2";
|
|||||||
# tn = 不換行版(給 prompt 用)
|
# tn = 不換行版(給 prompt 用)
|
||||||
tn() { if [ "$IS_ZH" = "yes" ]; then printf '%s' "$1"; else printf '%s' "$2"; fi; }
|
tn() { if [ "$IS_ZH" = "yes" ]; then printf '%s' "$1"; else printf '%s' "$2"; fi; }
|
||||||
|
|
||||||
REPO_URL="https://git.uncle6.me/Leo/system-dev-template/raw/branch/main/template"
|
# 來源預設=公開 GitHub(leo 2026-07-21:「要發佈的正稿,從頭就不要用奇怪的網址,
|
||||||
|
# 以免改來改去」)。內部指向私有草稿源時用環境變數覆寫,不改檔:
|
||||||
|
# TEMPLATE_SOURCE=https://<私有 raw base> bash scripts/install.sh
|
||||||
|
TEMPLATE_SOURCE="${TEMPLATE_SOURCE:-https://raw.githubusercontent.com/youlinhsieh/system-dev-template/main}"
|
||||||
|
REPO_URL="$TEMPLATE_SOURCE/template"
|
||||||
# install.sh / update.sh 住在 main/scripts/(不在 template/)。
|
# install.sh / update.sh 住在 main/scripts/(不在 template/)。
|
||||||
SCRIPTS_URL="https://git.uncle6.me/Leo/system-dev-template/raw/branch/main/scripts"
|
SCRIPTS_URL="$TEMPLATE_SOURCE/scripts"
|
||||||
CREATED=()
|
CREATED=()
|
||||||
SKIPPED=()
|
SKIPPED=()
|
||||||
|
|
||||||
@@ -115,7 +119,7 @@ if [ -d "system-dev" ] || [ -d ".claude/wiki" ] || [ -f ".claude/VERSION" ]; the
|
|||||||
t " 後續的更新、遷移、補新檔,一律由「更新腳本」處理(不要重跑 install):" \
|
t " 後續的更新、遷移、補新檔,一律由「更新腳本」處理(不要重跑 install):" \
|
||||||
" All updates, migrations, and new-file additions are handled by the UPDATER (don't re-run install):"
|
" All updates, migrations, and new-file additions are handled by the UPDATER (don't re-run install):"
|
||||||
echo ""
|
echo ""
|
||||||
echo " curl -sSL https://git.uncle6.me/Leo/system-dev-template/raw/branch/main/scripts/update.sh | bash"
|
echo " curl -sSL https://raw.githubusercontent.com/youlinhsieh/system-dev-template/main/scripts/update.sh | bash"
|
||||||
echo ""
|
echo ""
|
||||||
t " (重跑 install 可能建出空白範本、跟你的真資料並存,故在此停止。)" \
|
t " (重跑 install 可能建出空白範本、跟你的真資料並存,故在此停止。)" \
|
||||||
" (Re-running install could create empty templates alongside your real data, so it stops here.)"
|
" (Re-running install could create empty templates alongside your real data, so it stops here.)"
|
||||||
|
|||||||
+5
-1
@@ -23,7 +23,11 @@ esac
|
|||||||
t() { if [ "$IS_ZH" = "yes" ]; then printf '%s\n' "$1"; else printf '%s\n' "$2"; fi; }
|
t() { if [ "$IS_ZH" = "yes" ]; then printf '%s\n' "$1"; else printf '%s\n' "$2"; fi; }
|
||||||
tn() { if [ "$IS_ZH" = "yes" ]; then printf '%s' "$1"; else printf '%s' "$2"; fi; }
|
tn() { if [ "$IS_ZH" = "yes" ]; then printf '%s' "$1"; else printf '%s' "$2"; fi; }
|
||||||
|
|
||||||
REPO_RAW="https://git.uncle6.me/Leo/system-dev-template/raw/branch/main"
|
# 來源預設=公開 GitHub(leo 2026-07-21:「要發佈的正稿,從頭就不要用奇怪的網址,
|
||||||
|
# 以免改來改去」)。發佈時不再需要改寫網址——寫死的就是對外正確的那一個。
|
||||||
|
# 內部要改指私有草稿源(Gitea/未來 CF git)時,用環境變數覆寫,不改檔:
|
||||||
|
# TEMPLATE_SOURCE=https://<你的私有 raw base> bash scripts/update.sh
|
||||||
|
REPO_RAW="${TEMPLATE_SOURCE:-https://raw.githubusercontent.com/youlinhsieh/system-dev-template/main}"
|
||||||
TEMPLATE_URL="$REPO_RAW/template"
|
TEMPLATE_URL="$REPO_RAW/template"
|
||||||
|
|
||||||
UPDATED=()
|
UPDATED=()
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# 單向:只寫 GitHub,永不回改 tasks.md(回寫 id 是本地端的事,且只在新 task 做一次)。
|
# 單向:只寫 GitHub,永不回改 tasks.md(回寫 id 是本地端的事,且只在新 task 做一次)。
|
||||||
#
|
#
|
||||||
# ── 輸入(由本地觸發端用 acr run -i 餵)──────────────────────────
|
# ── 輸入(由本地觸發端用 acr run -i 餵)──────────────────────────
|
||||||
# owner GitHub repo owner(例:uncle6me-web)
|
# owner GitHub repo owner(例:your-github-account)
|
||||||
# repo GitHub repo 名
|
# repo GitHub repo 名
|
||||||
# project_id GitHub Projects v2 的 node id(投影目標,唯讀看板)
|
# project_id GitHub Projects v2 的 node id(投影目標,唯讀看板)
|
||||||
# tasks_json 本地分類好的增量陣列,每筆形如:
|
# tasks_json 本地分類好的增量陣列,每筆形如:
|
||||||
|
|||||||
Reference in New Issue
Block a user