@crievo/omni 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tools/lib/agents.mjs +6 -1
package/package.json
CHANGED
package/tools/lib/agents.mjs
CHANGED
|
@@ -54,7 +54,12 @@ export const expandHome = p =>
|
|
|
54
54
|
.trim()
|
|
55
55
|
.replace(/^~(?=\/|$)/, homedir()),
|
|
56
56
|
);
|
|
57
|
-
|
|
57
|
+
/* on Windows the folder is written `~/…` too (expandHome only expands `~/`), so it reads back the same */
|
|
58
|
+
export const tildify = p => {
|
|
59
|
+
if (!p.startsWith(homedir())) return p;
|
|
60
|
+
const rest = p.slice(homedir().length);
|
|
61
|
+
return `~${process.platform === "win32" ? rest.replace(/\\/g, "/") : rest}`;
|
|
62
|
+
};
|
|
58
63
|
|
|
59
64
|
function readJson(file) {
|
|
60
65
|
try {
|