feat(desktop): add --reset flag to clear user data for testing

- Add reset-user-data.sh script to clear ~/.super-multica/
- Add --reset CLI flag to clear localStorage on startup
- Add dev:reset npm script for development testing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Naiyuan Qing 2026-02-11 11:46:31 +08:00
parent c0db46e200
commit 4961604f31
3 changed files with 56 additions and 1 deletions

44
scripts/reset-user-data.sh Executable file
View file

@ -0,0 +1,44 @@
#!/bin/bash
# Reset all user data for super-multica desktop app
# Use this to simulate a fresh install for testing
set -e
echo "🧹 Resetting Super Multica user data..."
# Main data directory
MULTICA_DATA_DIR="$HOME/.super-multica"
if [ -d "$MULTICA_DATA_DIR" ]; then
echo " Removing $MULTICA_DATA_DIR"
rm -rf "$MULTICA_DATA_DIR"
else
echo " $MULTICA_DATA_DIR does not exist, skipping"
fi
# Electron app data (macOS)
if [[ "$OSTYPE" == "darwin"* ]]; then
ELECTRON_APP_DATA="$HOME/Library/Application Support/super-multica"
if [ -d "$ELECTRON_APP_DATA" ]; then
echo " Removing $ELECTRON_APP_DATA"
rm -rf "$ELECTRON_APP_DATA"
else
echo " $ELECTRON_APP_DATA does not exist, skipping"
fi
fi
# Electron app data (Linux)
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
ELECTRON_APP_DATA="$HOME/.config/super-multica"
if [ -d "$ELECTRON_APP_DATA" ]; then
echo " Removing $ELECTRON_APP_DATA"
rm -rf "$ELECTRON_APP_DATA"
else
echo " $ELECTRON_APP_DATA does not exist, skipping"
fi
fi
echo "✅ User data reset complete!"
echo ""
echo "Next steps:"
echo " pnpm dev # Start app (will show onboarding)"
echo " pnpm dev:reset # Reset and start in one command"