Skip to content

Commit

Permalink
Print out directory tree during docusaurus-init (#665)
Browse files Browse the repository at this point in the history
* WIP does not work

* rm -rf website/

Run docusaurus-init

Even by deleting text here, it still shows up? Confused.

* Shift in tree printing logic

* Shift printing logic to the current location
  • Loading branch information
amyrlam authored and yangshun committed May 16, 2018
1 parent c730bc7 commit 1796764
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
14 changes: 7 additions & 7 deletions lib/copy-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ if (feature === 'translations') {
);
}
});
}

if (exampleSiteCreated) {
console.log(
`${chalk.green('Example website created')} in ${chalk.green(
outerFolder + '/website'
)}\n`
);
if (exampleSiteCreated) {
const tree = require('tree-node-cli');
const dirString = tree(path.join(CWD, '..'), {
exclude: [/node_modules/],
});
console.log(dirString);
}
}

if (docsCreated) {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"request": "^2.81.0",
"shelljs": "^0.7.8",
"sitemap": "^1.13.0",
"tcp-port-used": "^0.1.2"
"tcp-port-used": "^0.1.2",
"tree-node-cli": "^1.1.1"
},
"bin": {
"docusaurus-start": "./lib/start-server.js",
Expand Down
8 changes: 7 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ combined-stream@1.0.6, combined-stream@~1.0.5:
dependencies:
delayed-stream "~1.0.0"

commander@^2.11.0:
commander@^2.11.0, commander@^2.15.1:
version "2.15.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f"

Expand Down Expand Up @@ -5596,6 +5596,12 @@ tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"

tree-node-cli@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/tree-node-cli/-/tree-node-cli-1.1.1.tgz#ea11f7e6ceec670355c64d0cc9b7090dddaefc33"
dependencies:
commander "^2.15.1"

trim-newlines@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613"
Expand Down

0 comments on commit 1796764

Please sign in to comment.