Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion profile/LICENSE.md

This file was deleted.

39 changes: 36 additions & 3 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Feature Distribution Tools
# Repository Management Tools

This directory contains tools to distribute the feature files from `/research/` to their respective repositories.
This directory contains tools to manage files across all serpapps repositories, including feature distribution and license management.

## Automated Distribution (GitHub Action)

Expand Down Expand Up @@ -80,4 +80,37 @@ features:
# ... up to 20 features
```

This format is compatible with the existing `generate-readme.js` script for automatic README generation.
This format is compatible with the existing `generate-readme.js` script for automatic README generation.

## LICENSE File Management

### Delete LICENSE Files

The `delete-license-files.js` script removes LICENSE files from all serpapps repositories.

#### Prerequisites:
- GitHub CLI (`gh`) installed and authenticated
- Appropriate permissions to modify serpapps repositories

#### Usage:
```bash
# Dry run to preview what would be deleted
node scripts/delete-license-files.js --dry-run

# Delete LICENSE files from all repositories
node scripts/delete-license-files.js

# Delete LICENSE files from a specific repository only
node scripts/delete-license-files.js --repo=youtube-downloader
```

#### What it does:
- Searches for common LICENSE file patterns (LICENSE, LICENSE.md, LICENSE.txt, etc.)
- Deletes found LICENSE files from all serpapps repositories
- Provides detailed logging and error handling
- Supports dry-run mode for safety

#### Common LICENSE patterns detected:
- `LICENSE`, `LICENSE.md`, `LICENSE.txt`, `LICENSE.rst`
- `LICENCE`, `LICENCE.md`, `LICENCE.txt`
- Various case variations (license, License, etc.)
106 changes: 106 additions & 0 deletions scripts/USAGE_EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Usage Examples for Repository Management Scripts

## LICENSE File Deletion

### Quick Start
```bash
# Preview what would be deleted (recommended first step)
node scripts/delete-license-files.js --dry-run

# Delete LICENSE files from all repositories
node scripts/delete-license-files.js

# Delete LICENSE files from a specific repository
node scripts/delete-license-files.js --repo=youtube-downloader
```

### Step-by-Step Process

1. **First, always run a dry-run to see what would be affected:**
```bash
node scripts/delete-license-files.js --dry-run
```

2. **Review the output to understand which repositories have LICENSE files**

3. **If you want to test with a single repository first:**
```bash
node scripts/delete-license-files.js --dry-run --repo=youtube-downloader
node scripts/delete-license-files.js --repo=youtube-downloader
```

4. **Run the full deletion across all repositories:**
```bash
node scripts/delete-license-files.js
```

### Prerequisites

Before running these scripts, ensure:

1. **GitHub CLI is installed and authenticated:**
```bash
# Install GitHub CLI (if not already installed)
# On macOS: brew install gh
# On Ubuntu: sudo apt install gh
# On Windows: winget install GitHub.cli

# Authenticate with GitHub
gh auth login

# Verify authentication
gh auth status
```

2. **You have appropriate permissions:**
- Write access to serpapps repositories
- Permission to delete files in those repositories

### Expected Output

The script provides detailed logging:
- ✅ Success messages for completed operations
- ⚠️ Warning messages for repositories that don't exist or aren't accessible
- ❌ Error messages for failed operations
- 📊 Summary statistics at the end

### Safety Features

- **Dry-run mode**: Always test first with `--dry-run`
- **Single repository testing**: Use `--repo=name` to test with one repository
- **Detailed logging**: See exactly what's happening
- **Error handling**: Script continues even if individual repositories fail
- **Backup recommendations**: Consider backing up important repositories before mass operations

### Common LICENSE File Patterns

The script searches for and deletes these common patterns:
- `LICENSE`, `LICENSE.md`, `LICENSE.txt`, `LICENSE.rst`
- `LICENCE`, `LICENCE.md`, `LICENCE.txt` (British spelling)
- `license`, `license.md`, `license.txt` (lowercase)
- `License`, `License.md`, `License.txt` (title case)

### Troubleshooting

**"GitHub CLI is not authenticated"**
```bash
gh auth login
```

**"Repository not found or not accessible"**
- The repository might not exist
- You might not have access permissions
- The repository might be private and you're not a collaborator

**"Command failed" errors**
- Check your internet connection
- Verify GitHub API is accessible
- Ensure you have write permissions to the repositories

### Recovery

If you need to restore LICENSE files:
1. The script doesn't create backups automatically
2. You can restore from git history in each repository
3. Consider using `git revert` on the deletion commits
4. Or manually recreate LICENSE files as needed
Loading