Skip to content

Commit 0e7c3ad

Browse files
author
Amelia Wattenberger
authored
Merge pull request #26 from cedric25/main
Start from a subdirectory
2 parents aa98244 + c65a5d5 commit 0e7c3ad

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ For example: dist,node_modules
2424

2525
Default: node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.vscode,package-lock.json,yarn.lock
2626

27+
28+
## `root_path`
29+
30+
The directory you want this action to run into.
31+
32+
Default: ./
33+
2734
## `max_depth`
2835

2936
The maximum number of nested folders to show files within. A higher number will take longer to render.

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
excluded_paths:
99
description: "A list of paths to exclude from the diagram, separated by commas. For example: dist,node_modules"
1010
required: false
11+
root_path:
12+
description: "The directory you want this action to run into. Default: ./"
13+
required: false
1114
max_depth:
1215
description: "The maximum number of nested folders to show files within. Default: 9"
1316
required: false

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17914,13 +17914,14 @@ var main = async () => {
1791417914
`${username}@users.noreply.github.com`
1791517915
]);
1791617916
core.endGroup();
17917+
const rootPath = core.getInput("root_path") || "./";
1791717918
const maxDepth = core.getInput("max_depth") || 9;
1791817919
const colorEncoding = core.getInput("color_encoding") || "type";
1791917920
const commitMessage = core.getInput("commit_message") || "Repo visualizer: updated diagram";
1792017921
const excludedPathsString = core.getInput("excluded_paths") || "node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock";
1792117922
const excludedPaths = excludedPathsString.split(",").map((str) => str.trim());
1792217923
const branch = core.getInput("branch");
17923-
const data = await processDir(`./`, excludedPaths);
17924+
const data = await processDir(rootPath, excludedPaths);
1792417925
const componentCodeString = import_server.default.renderToStaticMarkup(/* @__PURE__ */ import_react3.default.createElement(Tree, {
1792517926
data,
1792617927
maxDepth: +maxDepth,

src/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ const main = async () => {
2222
core.endGroup()
2323

2424

25+
const rootPath = core.getInput("root_path") || "./";
2526
const maxDepth = core.getInput("max_depth") || 9
2627
const colorEncoding = core.getInput("color_encoding") || "type"
2728
const commitMessage = core.getInput("commit_message") || "Repo visualizer: updated diagram"
2829
const excludedPathsString = core.getInput("excluded_paths") || "node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock"
2930
const excludedPaths = excludedPathsString.split(",").map(str => str.trim())
3031
const branch = core.getInput("branch")
31-
const data = await processDir(`./`, excludedPaths);
32+
const data = await processDir(rootPath, excludedPaths);
3233

3334
const componentCodeString = ReactDOMServer.renderToStaticMarkup(
3435
<Tree data={data} maxDepth={+maxDepth} colorEncoding={colorEncoding} />

0 commit comments

Comments
 (0)