make-folder-txt 2.2.4 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -643,7 +643,8 @@ function createInteractiveConfig() {
643
643
  if (config.addToTxtIgnore && (config.ignoreFolders.length > 0 || config.ignoreFiles.length > 0)) {
644
644
  console.log(`šŸ“ Ignore patterns added to .txtignore`);
645
645
  }
646
- console.log('\nšŸ’” You can now run: make-folder-txt --use-config');
646
+ console.log('\nšŸ’” Your settings will now be used automatically!');
647
+ console.log('šŸ”„ Run --delete-config to reset to defaults');
647
648
 
648
649
  } catch (err) {
649
650
  console.error('āŒ Error saving configuration:', err.message);
@@ -692,7 +693,31 @@ async function main() {
692
693
  process.exit(0);
693
694
  }
694
695
 
695
- if (args.includes("--use-config")) {
696
+ if (args.includes("--delete-config")) {
697
+ try {
698
+ const fs = require('fs');
699
+ const path = require('path');
700
+ const configPath = path.join(process.cwd(), '.txtconfig');
701
+
702
+ if (fs.existsSync(configPath)) {
703
+ fs.unlinkSync(configPath);
704
+ console.log('āœ… Configuration file deleted successfully!');
705
+ console.log('šŸ”„ Tool will now use default settings');
706
+ } else {
707
+ console.log('ā„¹ļø No configuration file found - already using defaults');
708
+ }
709
+ } catch (err) {
710
+ console.error('āŒ Error deleting configuration:', err.message);
711
+ }
712
+ process.exit(0);
713
+ }
714
+
715
+ // Auto-use config if it exists and no other flags are provided
716
+ const configPath = path.join(process.cwd(), '.txtconfig');
717
+ const hasConfig = fs.existsSync(configPath);
718
+ const hasOtherFlags = args.length > 0 && !args.includes('--help') && !args.includes('-h') && !args.includes('--version') && !args.includes('-v');
719
+
720
+ if (hasConfig && !hasOtherFlags) {
696
721
  const config = loadConfig();
697
722
 
698
723
  // Apply config to command line arguments
@@ -718,6 +743,7 @@ async function main() {
718
743
 
719
744
  // Replace args with config-based args
720
745
  args.splice(0, args.length, ...newArgs);
746
+ console.log('šŸ”§ Using saved configuration (use --delete-config to reset to defaults)');
721
747
  }
722
748
 
723
749
  if (args.includes("--help") || args.includes("-h")) {
@@ -740,7 +766,7 @@ Dump an entire project folder into a single readable .txt file.
740
766
  --copy Copy output to clipboard
741
767
  --force Include everything (overrides all ignore patterns)
742
768
  --make-config Create interactive configuration
743
- --use-config Use configuration from .txtconfig file
769
+ --delete-config Delete configuration and reset to defaults
744
770
  --help, -h Show this help message
745
771
  --version, -v Show version information
746
772
 
@@ -763,7 +789,7 @@ Dump an entire project folder into a single readable .txt file.
763
789
  make-folder-txt --only-file package.json README.md
764
790
  make-folder-txt -ofi package.json README.md
765
791
  make-folder-txt --make-config
766
- make-folder-txt --use-config
792
+ make-folder-txt --delete-config
767
793
 
768
794
  \x1b[33m.TXTIGNORE FILE\x1b[0m
769
795
  Create a .txtignore file in your project root to specify files/folders to ignore.
@@ -1035,7 +1061,12 @@ Dump an entire project folder into a single readable .txt file.
1035
1061
  ignoreFiles,
1036
1062
  onlyFolders,
1037
1063
  onlyFiles,
1038
- { rootName, txtIgnore, force: forceFlag }
1064
+ {
1065
+ rootName,
1066
+ txtIgnore,
1067
+ force: forceFlag,
1068
+ hasOnlyFilters: onlyFolders.size > 0 || onlyFiles.size > 0
1069
+ }
1039
1070
  );
1040
1071
 
1041
1072
  // ── build output filename ───────────────────────────────────────────────────────────