From bbb7cc5620681a95225161acf09955195d24ba4d Mon Sep 17 00:00:00 2001 From: Victor Bjelkholm Date: Tue, 23 Jan 2018 17:36:34 +0100 Subject: [PATCH] fix: (cli/init) use cross-platform path separator This fixes the command "init" on windows. Before this change, none of the files where actually added to your local repository. With this change, files are correctly added to the repository as windows uses "\" as the path separator instead of "/" (posix) --- src/core/components/init-assets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/components/init-assets.js b/src/core/components/init-assets.js index af47565d20..945c47f5b4 100644 --- a/src/core/components/init-assets.js +++ b/src/core/components/init-assets.js @@ -11,7 +11,7 @@ const CID = require('cids') // Add the default assets to the repo. module.exports = function addDefaultAssets (self, log, callback) { const initDocsPath = path.join(__dirname, '../../init-files/init-docs') - const index = initDocsPath.lastIndexOf('/') + const index = initDocsPath.lastIndexOf(path.sep) pull( pull.values([initDocsPath]),