From 046170e3ecfa1fbd98c55b537de6119ff0c2242a Mon Sep 17 00:00:00 2001 From: David Baker Date: Sat, 15 Feb 2020 20:17:35 +0000 Subject: [PATCH] Less hacky fix for yarnrc --- scripts/hak/link.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/hak/link.js b/scripts/hak/link.js index d3f696a..3ed040f 100644 --- a/scripts/hak/link.js +++ b/scripts/hak/link.js @@ -36,11 +36,11 @@ async function link(hakEnv, moduleInfo) { // relative to the closest project root, which means when we run it // in the dependency project, it will put the link directory in its // own project folder rather than the main project. - // 2. We put a colon on the end of the key, which is not what yarn's - // stringifier does and not really the format of the file, but it happens - // to work and also work around the bug where the parser breaks on values - // with a colon in them (which absolute windows paths do). - '--link-folder: ' + path.join(hakEnv.dotHakDir, 'links') + os.EOL, + // 2. The parser gets very confused by strings with colons in them + // (ie. Windows absolute paths) but strings in quotes get parsed as + // JSON so need to be valid JSON encoded strings (ie. have the + // backslashes escaped). JSON.stringify will add quotes and escape. + '--link-folder ' + JSON.stringify(path.join(hakEnv.dotHakDir, 'links')) + os.EOL, ); }