chore: apply linting fixes to PR #8 changes
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -74,9 +74,10 @@ Then generate a customized CLAUDE.md file tailored to their needs.
|
|||||||
- **On macOS only:** Ask: "Is your vault stored in iCloud Drive? (yes/no)"
|
- **On macOS only:** Ask: "Is your vault stored in iCloud Drive? (yes/no)"
|
||||||
- If yes (macOS): "Please enter the full path to your vault (e.g.,
|
- If yes (macOS): "Please enter the full path to your vault (e.g.,
|
||||||
~/Library/Mobile Documents/iCloud~md~obsidian/Documents/YourVault)"
|
~/Library/Mobile Documents/iCloud~md~obsidian/Documents/YourVault)"
|
||||||
- If no, or on Linux/Windows: "Please enter the path to your existing vault,
|
- If no, or on Linux/Windows: "Please enter the path to your existing
|
||||||
or type 'skip' to start fresh"
|
vault, or type 'skip' to start fresh"
|
||||||
- **Validate user-provided paths** (see "User Path Validation" section below)
|
- **Validate user-provided paths** (see "User Path Validation" section
|
||||||
|
below)
|
||||||
- If no existing vault or user skips, they're starting fresh
|
- If no existing vault or user skips, they're starting fresh
|
||||||
|
|
||||||
4. **Ask Configuration Questions**
|
4. **Ask Configuration Questions**
|
||||||
@@ -363,18 +364,23 @@ If the user's response is unclear:
|
|||||||
|
|
||||||
### Platform Compatibility
|
### Platform Compatibility
|
||||||
|
|
||||||
This command is designed to work across Linux, macOS, and Windows (WSL/Git Bash), with platform-specific features:
|
This command is designed to work across Linux, macOS, and Windows (WSL/Git
|
||||||
|
Bash), with platform-specific features:
|
||||||
|
|
||||||
**All Platforms:**
|
**All Platforms:**
|
||||||
|
|
||||||
- Search ~/Documents, ~/Desktop, home directory
|
- Search ~/Documents, ~/Desktop, home directory
|
||||||
- Standard Obsidian vault detection
|
- Standard Obsidian vault detection
|
||||||
- Full vault import and setup
|
- Full vault import and setup
|
||||||
|
|
||||||
**macOS Only:**
|
**macOS Only:**
|
||||||
|
|
||||||
- iCloud Drive vault detection and import
|
- iCloud Drive vault detection and import
|
||||||
- Obsidian's iCloud sync is macOS-only, so iCloud features are disabled on other platforms
|
- Obsidian's iCloud sync is macOS-only, so iCloud features are disabled on other
|
||||||
|
platforms
|
||||||
|
|
||||||
**Platform Detection:**
|
**Platform Detection:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Check platform
|
# Check platform
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
@@ -419,11 +425,14 @@ The iCloud path requires:
|
|||||||
- Silent error handling (2>/dev/null) as many users won't have iCloud
|
- Silent error handling (2>/dev/null) as many users won't have iCloud
|
||||||
- Platform check (macOS only)
|
- Platform check (macOS only)
|
||||||
|
|
||||||
**Error Handling Note:** Permission errors are suppressed (2>/dev/null) because they're expected when searching system directories. If no vaults are found, the script gracefully prompts the user for their vault path.
|
**Error Handling Note:** Permission errors are suppressed (2>/dev/null) because
|
||||||
|
they're expected when searching system directories. If no vaults are found, the
|
||||||
|
script gracefully prompts the user for their vault path.
|
||||||
|
|
||||||
### User Path Validation
|
### User Path Validation
|
||||||
|
|
||||||
When users manually provide a vault path, validate it thoroughly with helpful error messages:
|
When users manually provide a vault path, validate it thoroughly with helpful
|
||||||
|
error messages:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# User provided path
|
# User provided path
|
||||||
@@ -487,9 +496,11 @@ echo "✓ Valid Obsidian vault found"
|
|||||||
```
|
```
|
||||||
|
|
||||||
This validation:
|
This validation:
|
||||||
|
|
||||||
- Expands `~` to home directory properly
|
- Expands `~` to home directory properly
|
||||||
- Resolves symlinks and relative paths to absolute paths
|
- Resolves symlinks and relative paths to absolute paths
|
||||||
- Checks all essential requirements (exists, is directory, has .obsidian, readable)
|
- Checks all essential requirements (exists, is directory, has .obsidian,
|
||||||
|
readable)
|
||||||
- Provides helpful, actionable error messages with suggestions
|
- Provides helpful, actionable error messages with suggestions
|
||||||
- Shows the resolved path so users understand what's being checked
|
- Shows the resolved path so users understand what's being checked
|
||||||
- Trusts users (allows symlinks, paths outside home directory)
|
- Trusts users (allows symlinks, paths outside home directory)
|
||||||
@@ -523,6 +534,7 @@ fi
|
|||||||
```
|
```
|
||||||
|
|
||||||
This provides a soft warning that:
|
This provides a soft warning that:
|
||||||
|
|
||||||
- Only runs on macOS for iCloud paths
|
- Only runs on macOS for iCloud paths
|
||||||
- Checks for placeholder files that indicate incomplete download
|
- Checks for placeholder files that indicate incomplete download
|
||||||
- Asks for confirmation if sync issues detected
|
- Asks for confirmation if sync issues detected
|
||||||
@@ -588,8 +600,8 @@ First-run marker removed
|
|||||||
Now let me ask you a few questions to customize your setup:
|
Now let me ask you a few questions to customize your setup:
|
||||||
|
|
||||||
🔍 **Searching for existing Obsidian vaults...** [Searches ~/Documents,
|
🔍 **Searching for existing Obsidian vaults...** [Searches ~/Documents,
|
||||||
~/Desktop, home directory, and parent directories. On macOS, also searches iCloud
|
~/Desktop, home directory, and parent directories. On macOS, also searches
|
||||||
Drive]
|
iCloud Drive]
|
||||||
|
|
||||||
### Case 1: Single Vault Found
|
### Case 1: Single Vault Found
|
||||||
|
|
||||||
@@ -642,8 +654,7 @@ You can migrate files to the PARA folders at your own pace.
|
|||||||
|
|
||||||
🔍 **No Obsidian vaults found in common locations.**
|
🔍 **No Obsidian vaults found in common locations.**
|
||||||
|
|
||||||
**On macOS:**
|
**On macOS:** Is your vault stored in iCloud Drive? (yes/no)
|
||||||
Is your vault stored in iCloud Drive? (yes/no)
|
|
||||||
|
|
||||||
User: yes
|
User: yes
|
||||||
|
|
||||||
@@ -659,9 +670,9 @@ Found vault at: ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/MyVault
|
|||||||
|
|
||||||
Would you like to import this vault? (yes/skip)
|
Would you like to import this vault? (yes/skip)
|
||||||
|
|
||||||
**On Linux/Windows:**
|
**On Linux/Windows:** Please enter the path to your existing Obsidian vault, or
|
||||||
Please enter the path to your existing Obsidian vault, or type 'skip' to start
|
type 'skip' to start fresh: (Example: ~/Documents/MyVault or
|
||||||
fresh: (Example: ~/Documents/MyVault or /home/user/obsidian-vault)
|
/home/user/obsidian-vault)
|
||||||
|
|
||||||
User: ~/Documents/MyVault
|
User: ~/Documents/MyVault
|
||||||
|
|
||||||
|
|||||||
@@ -100,14 +100,17 @@ echo "📝 Config file: $CONFIG_FILE"
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Key improvements:**
|
**Key improvements:**
|
||||||
- Uses `$SHELL` to detect default shell (not `$ZSH_VERSION`/`$BASH_VERSION` which detect current session)
|
|
||||||
|
- Uses `$SHELL` to detect default shell (not `$ZSH_VERSION`/`$BASH_VERSION`
|
||||||
|
which detect current session)
|
||||||
- Supports command-line argument to override auto-detection
|
- Supports command-line argument to override auto-detection
|
||||||
- Shows detected shell and config file for transparency
|
- Shows detected shell and config file for transparency
|
||||||
- Validates shell type and provides clear error message for unsupported shells
|
- Validates shell type and provides clear error message for unsupported shells
|
||||||
|
|
||||||
## Installation Steps
|
## Installation Steps
|
||||||
|
|
||||||
1. **Detect shell**: Use argument if provided, otherwise auto-detect from `$SHELL`
|
1. **Detect shell**: Use argument if provided, otherwise auto-detect from
|
||||||
|
`$SHELL`
|
||||||
2. **Get vault path**: Use `pwd` to get current directory
|
2. **Get vault path**: Use `pwd` to get current directory
|
||||||
3. **Escape the path**: Properly escape quotes and special characters for shell
|
3. **Escape the path**: Properly escape quotes and special characters for shell
|
||||||
safety
|
safety
|
||||||
@@ -154,6 +157,7 @@ echo "📝 Config file: $CONFIG_FILE"
|
|||||||
## Handling Special Characters
|
## Handling Special Characters
|
||||||
|
|
||||||
The implementation properly handles paths with:
|
The implementation properly handles paths with:
|
||||||
|
|
||||||
- Spaces: `/Users/noah/My Vault`
|
- Spaces: `/Users/noah/My Vault`
|
||||||
- Quotes: `/Users/noah/vault's backup`
|
- Quotes: `/Users/noah/vault's backup`
|
||||||
- Special characters that need escaping
|
- Special characters that need escaping
|
||||||
@@ -190,6 +194,7 @@ Install for specific shell (override auto-detection):
|
|||||||
```
|
```
|
||||||
|
|
||||||
**When to specify shell:**
|
**When to specify shell:**
|
||||||
|
|
||||||
- You use multiple shells and want to install for a specific one
|
- You use multiple shells and want to install for a specific one
|
||||||
- Auto-detection picked the wrong shell
|
- Auto-detection picked the wrong shell
|
||||||
- You're setting up for someone else
|
- You're setting up for someone else
|
||||||
|
|||||||
Reference in New Issue
Block a user