updates
This commit is contained in:
@@ -15,6 +15,10 @@ Then, cd into the directory and run the following command:
|
||||
```bash
|
||||
python3 install_scripts.py
|
||||
```
|
||||
If updating scripts (and have already added ~/bin/ to the system PATH) run with the --upgrade parameter:
|
||||
```bash
|
||||
python3 install_scripts.py --upgrade
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
def find_files_starting_with(prefix):
|
||||
# Get the list of all files and directories in the current working directory
|
||||
@@ -60,6 +61,14 @@ def main():
|
||||
# Define the prefix
|
||||
prefix = "cmg-"
|
||||
|
||||
# Create an argument parser object
|
||||
parser = argparse.ArgumentParser(description='Check for a specific flag.')
|
||||
# Add a flag argument to the parser
|
||||
parser.add_argument('-u', '--upgrade', action="store_true", help='Specify to not copy ~/bin/ to PATH')
|
||||
|
||||
# Parse the command-line arguments
|
||||
args = parser.parse_args()
|
||||
|
||||
# Find all files starting with the given prefix
|
||||
source_files = find_files_starting_with(prefix)
|
||||
# source_files = ['cmg-get-drive-link.py', 'cmg-split-zip-smaller-chunks.py'] # Add your script names here
|
||||
@@ -78,7 +87,8 @@ def main():
|
||||
copy_files_to_bin(source_files, bin_path)
|
||||
|
||||
# Ensure bin is in the system path
|
||||
ensure_bin_in_path(bin_path)
|
||||
if not args.upgrade:
|
||||
ensure_bin_in_path(bin_path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user