Skip to content

add reruning script, moved dir creation to separated func, sumodule support#66

Open
Zkh-dot wants to merge 3 commits into
Shpota:mainfrom
Zkh-dot:main
Open

add reruning script, moved dir creation to separated func, sumodule support#66
Zkh-dot wants to merge 3 commits into
Shpota:mainfrom
Zkh-dot:main

Conversation

@Zkh-dot

@Zkh-dot Zkh-dot commented Dec 26, 2024

Copy link
Copy Markdown

I think it is better to have an option to re-run script multiple times without creating new repo each time. added function chdir_to_repo to automatically clone existing repo and prevent trying to overwrite it's history

also it is possible, that someone could run script after cloning this repo from it's folder, so added functionality to clone repo as submodule, so it will not cause any issues

fixing #67

@chaitu20000 chaitu20000 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added create_directory function

def create_directory(directory: str) -> None:
os.mkdir(directory)
os.chdir(directory)

Modified chdir_to_repo to include submodule support

def chdir_to_repo(repository, directory) -> None:
git_command = ['git', repository, directory]
if ".git" in os.listdir():
git_command.insert(1, 'submodule')
git_command.insert(2, 'add')
else:
git_command.insert(1, 'clone')

@Zkh-dot

Zkh-dot commented Feb 18, 2025

Copy link
Copy Markdown
Author

Added create_directory function

def create_directory(directory: str) -> None: os.mkdir(directory) os.chdir(directory)

Modified chdir_to_repo to include submodule support

def chdir_to_repo(repository, directory) -> None: git_command = ['git', repository, directory] if ".git" in os.listdir(): git_command.insert(1, 'submodule') git_command.insert(2, 'add') else: git_command.insert(1, 'clone')

yeah, thats good, will add shortly

@Zkh-dot

Zkh-dot commented Feb 24, 2025

Copy link
Copy Markdown
Author

Added create_directory function

def create_directory(directory: str) -> None: os.mkdir(directory) os.chdir(directory)

Modified chdir_to_repo to include submodule support

def chdir_to_repo(repository, directory) -> None: git_command = ['git', repository, directory] if ".git" in os.listdir(): git_command.insert(1, 'submodule') git_command.insert(2, 'add') else: git_command.insert(1, 'clone')

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants