make-folder-txt 2.1.4 → 2.2.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-folder-txt",
3
- "version": "2.1.4",
3
+ "version": "2.2.1",
4
4
  "description": "Generate a single .txt file containing the full folder structure and file contents of any project, ignoring node_modules and other junk.",
5
5
  "main": "bin/make-folder-txt.js",
6
6
  "bin": {
@@ -1,75 +0,0 @@
1
- # PowerShell completion installation script for make-folder-txt
2
-
3
- function Install-MakeFolderTxtCompletion {
4
- param(
5
- [switch]$Force,
6
- [switch]$CurrentUser
7
- )
8
-
9
- $ErrorActionPreference = 'Stop'
10
-
11
- # Determine PowerShell profile path
12
- if ($CurrentUser) {
13
- $profilePath = $PROFILE.CurrentUserCurrentHost
14
- } else {
15
- $profilePath = $PROFILE.AllUsersCurrentHost
16
- }
17
-
18
- # Create profile directory if it doesn't exist
19
- $profileDir = Split-Path $profilePath -Parent
20
- if (-not (Test-Path $profileDir)) {
21
- try {
22
- New-Item -ItemType Directory -Path $profileDir -Force | Out-Null
23
- Write-Host "Created profile directory: $profileDir" -ForegroundColor Green
24
- } catch {
25
- Write-Error "Failed to create profile directory: $profileDir"
26
- return
27
- }
28
- }
29
-
30
- # Get the completion script content
31
- $completionScriptPath = Join-Path $PSScriptRoot 'make-folder-txt-completion.ps1'
32
- if (-not (Test-Path $completionScriptPath)) {
33
- Write-Error "Completion script not found: $completionScriptPath"
34
- return
35
- }
36
-
37
- $completionContent = Get-Content $completionScriptPath -Raw
38
-
39
- # Check if completion is already installed
40
- if (Test-Path $profilePath) {
41
- $profileContent = Get-Content $profilePath -Raw
42
- if ($profileContent -match 'make-folder-txt.*completion') {
43
- if (-not $Force) {
44
- Write-Host "make-folder-txt completion is already installed in $profilePath" -ForegroundColor Yellow
45
- Write-Host "Use -Force to reinstall" -ForegroundColor Yellow
46
- return
47
- }
48
- Write-Host "Removing existing completion..." -ForegroundColor Yellow
49
- # Remove existing completion
50
- $profileContent = $profileContent -replace '(?s)# make-folder-txt completion.*?Register-ArgumentComplester.*?Export-ModuleMember.*?\n', ''
51
- Set-Content $profilePath $profileContent -Force
52
- }
53
- }
54
-
55
- # Add completion to profile
56
- $completionBlock = @"
57
-
58
- # make-folder-txt completion
59
- $completionContent
60
- "@
61
-
62
- try {
63
- Add-Content $profilePath $completionBlock -Force
64
- Write-Host "✅ PowerShell completion installed successfully!" -ForegroundColor Green
65
- Write-Host "Added to: $profilePath" -ForegroundColor Cyan
66
- Write-Host "Restart PowerShell or run: . `$profile" -ForegroundColor Cyan
67
- } catch {
68
- Write-Error "Failed to install completion: $_"
69
- }
70
- }
71
-
72
- # Auto-install if script is run directly
73
- if ($MyInvocation.InvocationName -eq $MyInvocation.MyCommand.Name) {
74
- Install-MakeFolderTxtCompletion -CurrentUser
75
- }
@@ -1,59 +0,0 @@
1
- #!/bin/bash
2
- # make-folder-txt bash completion
3
-
4
- _make_folder_txt_completion() {
5
- local cur prev opts
6
- COMPREPLY=()
7
- cur="${COMP_WORDS[COMP_CWORD]}"
8
- prev="${COMP_WORDS[COMP_CWORD-1]}"
9
-
10
- opts="--ignore-folder -ifo --ignore-file -ifi --only-folder -ofo --only-file -ofi --skip-large --no-skip --split-method --split-size --copy --force --help --version -h -v"
11
-
12
- case "${prev}" in
13
- --ignore-folder|-ifo)
14
- # Complete with folder names in current directory
15
- local folders=$(ls -d */ 2>/dev/null | sed 's|/||g')
16
- COMPREPLY=( $(compgen -W "${folders}" -- ${cur}) )
17
- return 0
18
- ;;
19
- --ignore-file|-ifi|--only-file|-ofi)
20
- # Complete with file names in current directory
21
- local files=$(ls -p 2>/dev/null | grep -v /)
22
- COMPREPLY=( $(compgen -W "${files}" -- ${cur}) )
23
- return 0
24
- ;;
25
- --only-folder|-ofo)
26
- # Complete with folder names in current directory
27
- local folders=$(ls -d */ 2>/dev/null | sed 's|/||g')
28
- COMPREPLY=( $(compgen -W "${folders}" -- ${cur}) )
29
- return 0
30
- ;;
31
- --skip-large)
32
- # Complete with common size formats
33
- local sizes="100KB 200KB 400KB 500KB 1MB 5MB 10MB 100MB 1GB 5GB"
34
- COMPREPLY=( $(compgen -W "${sizes}" -- ${cur}) )
35
- return 0
36
- ;;
37
- --split-method)
38
- # Complete with split methods
39
- local methods="folder file size"
40
- COMPREPLY=( $(compgen -W "${methods}" -- ${cur}) )
41
- return 0
42
- ;;
43
- --split-size)
44
- # Complete with common size formats
45
- local sizes="1MB 5MB 10MB 50MB 100MB 500MB 1GB"
46
- COMPREPLY=( $(compgen -W "${sizes}" -- ${cur}) )
47
- return 0
48
- ;;
49
- *)
50
- ;;
51
- esac
52
-
53
- if [[ ${cur} == -* ]]; then
54
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
55
- return 0
56
- fi
57
- }
58
-
59
- complete -F _make_folder_txt_completion make-folder-txt
@@ -1,95 +0,0 @@
1
- # make-folder-txt PowerShell completion script
2
-
3
- Register-ArgumentCompleter -Native -CommandName 'make-folder-txt' -ScriptBlock {
4
- param($commandName, $wordToComplete, $commandAst, $fakeBoundParameters)
5
-
6
- # Get the current argument being completed
7
- $currentArgument = $wordToComplete
8
-
9
- # Define available options
10
- $options = @(
11
- '--ignore-folder', '-ifo',
12
- '--ignore-file', '-ifi',
13
- '--only-folder', '-ofo',
14
- '--only-file', '-ofi',
15
- '--skip-large',
16
- '--no-skip',
17
- '--split-method',
18
- '--split-size',
19
- '--copy',
20
- '--force',
21
- '--install-completion',
22
- '--help', '-h',
23
- '--version', '-v'
24
- )
25
-
26
- # Get the previous parameter to determine context
27
- $previousParameter = if ($commandAst.CommandElements.Count -gt 1) {
28
- $commandAst.CommandElements[-2].Extent.Text
29
- } else {
30
- ''
31
- }
32
-
33
- switch ($previousParameter) {
34
- { $_ -in '--ignore-folder', '-ifo', '--only-folder', '-ofo' } {
35
- # Complete with folder names
36
- try {
37
- $folders = Get-ChildItem -Directory -Name | Where-Object { $_ -like "*$currentArgument*" }
38
- return $folders | ForEach-Object {
39
- [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', "Folder: $_")
40
- }
41
- } catch {
42
- return @()
43
- }
44
- }
45
- { $_ -in '--ignore-file', '-ifi', '--only-file', '-ofi' } {
46
- # Complete with file names
47
- try {
48
- $files = Get-ChildItem -File -Name | Where-Object { $_ -like "*$currentArgument*" }
49
- return $files | ForEach-Object {
50
- [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', "File: $_")
51
- }
52
- } catch {
53
- return @()
54
- }
55
- }
56
- '--skip-large' {
57
- # Complete with common size formats
58
- $sizes = @('100KB', '200KB', '400KB', '500KB', '1MB', '5MB', '10MB', '100MB', '1GB', '5GB')
59
- $matchingSizes = $sizes | Where-Object { $_ -like "*$currentArgument*" }
60
- return $matchingSizes | ForEach-Object {
61
- [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', "Size: $_")
62
- }
63
- }
64
- '--split-method' {
65
- # Complete with split methods
66
- $methods = @('folder', 'file', 'size')
67
- $matchingMethods = $methods | Where-Object { $_ -like "*$currentArgument*" }
68
- return $matchingMethods | ForEach-Object {
69
- [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', "Method: $_")
70
- }
71
- }
72
- '--split-size' {
73
- # Complete with common size formats
74
- $sizes = @('1MB', '5MB', '10MB', '50MB', '100MB', '500MB', '1GB')
75
- $matchingSizes = $sizes | Where-Object { $_ -like "*$currentArgument*" }
76
- return $matchingSizes | ForEach-Object {
77
- [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', "Size: $_")
78
- }
79
- }
80
- default {
81
- # Complete with options
82
- if ($currentArgument -like '-*') {
83
- $matchingOptions = $options | Where-Object { $_ -like "*$currentArgument*" }
84
- return $matchingOptions | ForEach-Object {
85
- [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', "Option: $_")
86
- }
87
- }
88
- }
89
- }
90
-
91
- return @()
92
- }
93
-
94
- # Export the completion function
95
- Export-ModuleMember -Function *
@@ -1,30 +0,0 @@
1
- #compdef make-folder-txt
2
- # make-folder-txt zsh completion
3
-
4
- _make_folder_txt() {
5
- local -a arguments
6
- arguments=(
7
- '--ignore-folder[Ignore specific folders by name]:folder:_directories'
8
- '-ifo[Ignore specific folders by name]:folder:_directories'
9
- '--ignore-file[Ignore specific files by name]:file:_files'
10
- '-ifi[Ignore specific files by name]:file:_files'
11
- '--only-folder[Include only specific folders]:folder:_directories'
12
- '-ofo[Include only specific folders]:folder:_directories'
13
- '--only-file[Include only specific files]:file:_files'
14
- '-ofi[Include only specific files]:file:_files'
15
- '--skip-large[Skip files larger than specified size]:size:(100KB 200KB 400KB 500KB 1MB 5MB 10MB 100MB 1GB 5GB)'
16
- '--no-skip[Include all files regardless of size]'
17
- '--split-method[Split output by method]:method:(folder file size)'
18
- '--split-size[Split output when size exceeds limit]:size:(1MB 5MB 10MB 50MB 100MB 500MB 1GB)'
19
- '--copy[Copy output to clipboard]'
20
- '--force[Include everything (overrides all ignore patterns)]'
21
- '--help[Show help message]'
22
- '--version[Show version information]'
23
- '-h[Show help message]'
24
- '-v[Show version information]'
25
- )
26
-
27
- _arguments -s -S $arguments && return 0
28
- }
29
-
30
- _make_folder_txt "$@"