Add mirror-source.sh: mirror full patched app source to dataset dshunt/anniversary-intimacy-source
Browse files- mirror-source.sh +35 -0
mirror-source.sh
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# mirror-source.sh — mirror the FULL patched anniversary-intimacy app source
|
| 3 |
+
# (docs, src, configs — everything except node_modules/dist) to:
|
| 4 |
+
# https://huggingface.co/datasets/dshunt/anniversary-intimacy-source
|
| 5 |
+
#
|
| 6 |
+
# Usage (after apply-push.sh, which clones + patches):
|
| 7 |
+
# HF_TOKEN=hf_xxx bash mirror-source.sh
|
| 8 |
+
#
|
| 9 |
+
# Get a token at https://huggingface.co/settings/tokens (scope: write).
|
| 10 |
+
|
| 11 |
+
set -euo pipefail
|
| 12 |
+
|
| 13 |
+
: "${HF_TOKEN:?Set HF_TOKEN env var (https://huggingface.co/settings/tokens, write scope)}"
|
| 14 |
+
TARGET="${TARGET:-dshunt/anniversary-intimacy-source}"
|
| 15 |
+
APP_DIR="${APP_DIR:-$HOME/next18-build/app/anniversary-intimacy}" # workdir from apply-push.sh
|
| 16 |
+
|
| 17 |
+
[ -f "$APP_DIR/src/App.tsx" ] || { echo "No patched app found at $APP_DIR — run apply-push.sh first."; exit 1; }
|
| 18 |
+
|
| 19 |
+
cd "$APP_DIR"
|
| 20 |
+
npm i --no-save @huggingface/hub >/dev/null 2>&1
|
| 21 |
+
|
| 22 |
+
node --input-type=module -e "
|
| 23 |
+
import { uploadFolder } from '@huggingface/hub';
|
| 24 |
+
await uploadFolder({
|
| 25 |
+
repo: 'dataset',
|
| 26 |
+
repoId: '${TARGET}',
|
| 27 |
+
folder: '${APP_DIR}',
|
| 28 |
+
ignorePatterns: ['node_modules/**', 'dist/**', '.vite/**', 'patch.mjs.bak'],
|
| 29 |
+
credentials: { accessToken: process.env.HF_TOKEN },
|
| 30 |
+
});
|
| 31 |
+
console.log('source mirrored');
|
| 32 |
+
"
|
| 33 |
+
|
| 34 |
+
echo ""
|
| 35 |
+
echo "✅ Full app source mirrored to https://huggingface.co/datasets/${TARGET}"
|