Skip to content
Dotweave Dotweave v0.39.7

Platform-Specific Paths

Handle cross-OS path differences for the same logical config.

Most config files live at different paths depending on your operating system. VS Code settings, for example, are stored in ~/.config/Code/User/ on Linux but ~/Library/Application Support/Code/User/ on macOS. dotweave handles this with platform-specific path objects in your manifest.jsonc.

Every path field in manifest.jsonc can be either a plain string or an object with one or more platform keys:

KeyMatches
linuxNative Linux
macmacOS
winWindows
wslWindows Subsystem for Linux
defaultAny platform not explicitly listed

When dotweave reads a path, it picks the best match in this order:

  1. Exact platform key — if your OS has a dedicated entry, that wins.
  2. Fallbackwsl falls back to linux if no wsl key exists.
  3. default — used when no other key matches.

If none of these resolve, the entry is skipped on that platform.

localPath tells dotweave where a file lives on your machine. Because this is the field most likely to differ across operating systems, it is always written as a platform object:

{
"localPath": {
"default": "~/.config/Code/User/settings.json",
"mac": "~/Library/Application Support/Code/User/settings.json",
"win": "%APPDATA%/Code/User/settings.json"
}
}

repoPath — usually the same, but can differ

Section titled “repoPath — usually the same, but can differ”

repoPath is the path inside the sync directory. Most of the time it’s identical across platforms, so a plain string is fine. If you need it to vary, use the same platform object format:

{
"repoPath": {
"default": "vscode/settings.json",
"win": "vscode-win/settings.json"
}
}

You can also set mode per platform. This is handy when a config only makes sense on certain operating systems:

{
"mode": {
"default": "copy",
"win": "ignore"
}
}

With this setup the file is synced everywhere except Windows, where it is silently skipped.

Here’s a complete entry for VS Code settings that works on Linux, macOS, and Windows:

{
"localPath": {
"default": "~/.config/Code/User/settings.json",
"mac": "~/Library/Application Support/Code/User/settings.json",
"win": "%APPDATA%/Code/User/settings.json"
},
"repoPath": "vscode/settings.json",
"mode": "copy"
}
  • You can always hand-edit manifest.jsonc to add or adjust platform keys.
  • dotweave track is a quick way to start — it captures the current platform’s path as default, and you can add other platforms later.
  • Use dotweave status to verify that paths resolve correctly on the current machine before pushing.