print-project
Advanced tools
Comparing version 1.0.23 to 1.0.24
@@ -35,3 +35,3 @@ #!/usr/bin/env node | ||
const program = new commander_1.Command(); | ||
program.argument("<startPath>", "Starting directory path").option("--ignore <patterns>", "Comma-separated list of patterns to ignore").option("--include <patterns>", "Comma-separated list of patterns to include").option("--ignore-default", "Disable default ignore patterns").parse(process.argv); | ||
program.argument("<startPath>", "Starting directory path").option("--ignore <patterns>", "Comma-separated list of patterns to ignore").option("--include <patterns>", "Comma-separated list of patterns to include").option("--remove-default", "Remove default ignore patterns").parse(process.argv); | ||
const startPath = program.args[0] && path.resolve(program.args[0]); | ||
@@ -41,6 +41,7 @@ const options = program.opts(); | ||
const includePatterns = options.include ? options.include.split(",").filter(Boolean).map((pattern) => pattern.trim()) : []; | ||
const shouldAddDefaultIgnorePatterns = !options.removeDefault; | ||
// Build the final ignore patterns list | ||
let ignorePatterns = ["project-print.txt"]; // Always ignore the output file | ||
// If NOT using --ignore-default, add default patterns FIRST | ||
if (!options.ignoreDefault) { | ||
if (shouldAddDefaultIgnorePatterns) { | ||
ignorePatterns = [...constants_1.defaultIgnorePatterns, ...ignorePatterns]; | ||
@@ -132,3 +133,3 @@ } | ||
console.log("Ignore patterns:", ignorePatterns.join(", ")); | ||
console.log("Using default ignore:", !options.ignoreDefault); | ||
console.log("Remove default:", !shouldAddDefaultIgnorePatterns); | ||
console.log(); | ||
@@ -135,0 +136,0 @@ readDirectory(startPath, treeStructure); |
{ | ||
"name": "print-project", | ||
"version": "1.0.23", | ||
"version": "1.0.24", | ||
"description": "A simple CLI tool to print the project tree structure and file contents", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -12,3 +12,3 @@ #!/usr/bin/env node | ||
const program = new Command(); | ||
program.argument("<startPath>", "Starting directory path").option("--ignore <patterns>", "Comma-separated list of patterns to ignore").option("--include <patterns>", "Comma-separated list of patterns to include").option("--ignore-default", "Disable default ignore patterns").parse(process.argv); | ||
program.argument("<startPath>", "Starting directory path").option("--ignore <patterns>", "Comma-separated list of patterns to ignore").option("--include <patterns>", "Comma-separated list of patterns to include").option("--remove-default", "Remove default ignore patterns").parse(process.argv); | ||
@@ -19,2 +19,3 @@ const startPath: string | undefined = program.args[0] && path.resolve(program.args[0]); | ||
const includePatterns: string[] = options.include ? options.include.split(",").filter(Boolean).map((pattern: string) => pattern.trim()) : []; | ||
const shouldAddDefaultIgnorePatterns: boolean = !options.removeDefault; | ||
@@ -25,3 +26,3 @@ // Build the final ignore patterns list | ||
// If NOT using --ignore-default, add default patterns FIRST | ||
if (!options.ignoreDefault) { | ||
if (shouldAddDefaultIgnorePatterns) { | ||
ignorePatterns = [...defaultIgnorePatterns, ...ignorePatterns]; | ||
@@ -124,3 +125,3 @@ } | ||
console.log("Ignore patterns:", ignorePatterns.join(", ")); | ||
console.log("Using default ignore:", !options.ignoreDefault); | ||
console.log("Remove default:", !shouldAddDefaultIgnorePatterns); | ||
console.log(); | ||
@@ -127,0 +128,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43877648
489