Repository navigation
fix(obsidian): pass --vault flag to open wiki vault on headless launch #1457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,2 +1,2 @@ | ||||||||
| #!/usr/bin/env bash | ||||||||
| exec @xvfbRun@/bin/xvfb-run -a @obsidian@/bin/obsidian --no-sandbox --disable-gpu "$@" | ||||||||
| exec @xvfbRun@/bin/xvfb-run -a @obsidian@/bin/obsidian --no-sandbox --disable-gpu --vault @homeDir@/ghq/github.com/shunkakinoki/wiki "$@" | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Verify whether --vault currently uses an unquoted `@homeDir`@ expansion.
rg -n -C2 -- '--vault[[:space:]]+@homeDir@/|--vault[[:space:]]+"\@homeDir\@/' home-manager/services/obsidian/obsidian-headless.shRepository: shunkakinoki/dotfiles Length of output: 243 🏁 Script executed: cat -n home-manager/services/obsidian/obsidian-headless.shRepository: shunkakinoki/dotfiles Length of output: 236 🏁 Script executed: # Check if this is a Nix file or similar template system
file home-manager/services/obsidian/obsidian-headless.sh
head -20 home-manager/services/obsidian/obsidian-headless.shRepository: shunkakinoki/dotfiles Length of output: 282 🏁 Script executed: # Search for the vault line more carefully without problematic regex
grep -n "vault" home-manager/services/obsidian/obsidian-headless.shRepository: shunkakinoki/dotfiles Length of output: 204 🏁 Script executed: # Find related Nix files for obsidian service
fd -e nix home-manager/services/obsidian/Repository: shunkakinoki/dotfiles Length of output: 494 🏁 Script executed: # Look for the Nix file that generates this shell script
rg -l "obsidian-headless" --type nix home-manager/Repository: shunkakinoki/dotfiles Length of output: 107 🏁 Script executed: # Check how `@homeDir`@ is used in similar scripts in the repo
rg "@homeDir@" --type sh -B2 -A2 | head -50Repository: shunkakinoki/dotfiles Length of output: 326 🏁 Script executed: cat home-manager/services/obsidian/default.nixRepository: shunkakinoki/dotfiles Length of output: 1344 🏁 Script executed: # Check other usages of `@homeDir`@ in shell scripts to see if they are quoted
rg "@homeDir@" --type sh -B1 -A1Repository: shunkakinoki/dotfiles Length of output: 326 🏁 Script executed: # Check if other `@homeDir`@ usages in shell templates are quoted
rg "@homeDir@" --type shRepository: shunkakinoki/dotfiles Length of output: 254 🏁 Script executed: # Check the Nix replaceVars function to understand how it handles escaping
rg "replaceVars" -A5 --type nix | head -40Repository: shunkakinoki/dotfiles Length of output: 2569 🏁 Script executed: # Check if there are other path variables substituted via replaceVars in shell scripts
rg "inherit.*homeDir|inherit.*home" --type nix -B5 -A5 | head -60Repository: shunkakinoki/dotfiles Length of output: 2586 🏁 Script executed: # Check how other `@variable`@ substitutions are handled in templates
rg '@[a-zA-Z]+@' --type sh -B1 -A1 | head -80Repository: shunkakinoki/dotfiles Length of output: 4172 🏁 Script executed: # Look for quoted patterns with @ variables
rg '"@[a-zA-Z]+@|'"'"'@[a-zA-Z]+@' --type shRepository: shunkakinoki/dotfiles Length of output: 4187 🏁 Script executed: # Check if there are tests for the obsidian script
cat spec/obsidian_headless_spec.shRepository: shunkakinoki/dotfiles Length of output: 1230 🏁 Script executed: # Look for how home directory paths are typically handled in Nix scripts
rg 'home.homeDirectory|homeDir' --type nix -B2 -A2 | head -60Repository: shunkakinoki/dotfiles Length of output: 4673 🏁 Script executed: # Check what homeDir typically expands to in this config
grep -r "homeDirectory.*=" named-hosts/kyber/default.nix hosts/linux/default.nix | head -5Repository: shunkakinoki/dotfiles Length of output: 276 🏁 Script executed: # Check if the test file includes any test for `@homeDir`@ or vault argument
grep -i "vault\|homeDir" spec/obsidian_headless_spec.shRepository: shunkakinoki/dotfiles Length of output: 47 🏁 Script executed: # Check if pkgs.replaceVars is documented or if there's guidance on escaping
rg "replaceVars|writeShellScriptBin" --type nix -B3 -A3 | grep -E "replaceVars|writeShellScriptBin|inherit|{$" | head -40Repository: shunkakinoki/dotfiles Length of output: 3480 🏁 Script executed: # Verify the actual username for kyber to understand the expanded path
grep -A5 "username.*=" named-hosts/kyber/default.nix | head -10Repository: shunkakinoki/dotfiles Length of output: 47 Quote the vault path argument. The templated home directory is passed unquoted to Suggested patch-exec `@xvfbRun`@/bin/xvfb-run -a `@obsidian`@/bin/obsidian --no-sandbox --disable-gpu --vault `@homeDir`@/ghq/github.com/shunkakinoki/wiki "$@"
+vault_path="@homeDir@/ghq/github.com/shunkakinoki/wiki"
+exec `@xvfbRun`@/bin/xvfb-run -a `@obsidian`@/bin/obsidian --no-sandbox --disable-gpu --vault "$vault_path" "$@"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vault path should be enclosed in double quotes to prevent word splitting if the home directory path contains spaces. While standard Linux home paths typically do not contain spaces, quoting is a best practice for shell script robustness and portability.