From 3d726c4897d25c1baa7e93fc0917dc4dbc79eee8 Mon Sep 17 00:00:00 2001 From: gk Date: Thu, 16 May 2019 04:07:27 +0900 Subject: [PATCH] fix: use format from get-meta-file for config formatting --- bin/meta-init | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/meta-init b/bin/meta-init index 0fad51b..1206be5 100755 --- a/bin/meta-init +++ b/bin/meta-init @@ -32,9 +32,11 @@ if (fs.existsSync('./.gitslave')) { metaJson.projects[key] = projectPairs[key]; } - console.log(`creating a .meta file in ${process.cwd()} with contents \n${JSON.stringify(metaJson, null, ' ')}`); + const metaString = getMetaFile.format(metaJson); - fs.writeFileSync(path.join(process.cwd(), '.meta'), JSON.stringify(metaJson, null, ' ')); + console.log(`creating a .meta file in ${process.cwd()} with contents\n${metaString.trim()}`); + + fs.writeFileSync(path.join(process.cwd(), '.meta'), metaString); }); @@ -42,6 +44,6 @@ if (fs.existsSync('./.gitslave')) { console.log(`creating a .meta file in ${process.cwd()}`); - fs.writeFileSync(path.join(process.cwd(), '.meta'), JSON.stringify(metaJson, null, ' ')); + fs.writeFileSync(path.join(process.cwd(), '.meta'), getMetaFile.format(metaJson)); } \ No newline at end of file