scripts

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 616bf3fc9a0e537c3c3d9fd5d823a872d623edcb
parent 06435fc16557a7e828dad24508e44d82f223577a
Author: Andrew Laack <andrew@laack.co>
Date:   Wed,  2 Jul 2025 10:24:19 -0500

Finished leetcode submission create and push script

Diffstat:
Dleetcode-submission.py | 6------
Aleetcode-submission.sh | 12++++++++++++
Mpython-files/create-leetcode.py | 7+------
3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/leetcode-submission.py b/leetcode-submission.py @@ -1,6 +0,0 @@ -#!/bin/bash - -# you could try using open instead of vim, but depending on the filetype -# you may run into issues. - -output=$(python3 ~/bin/python-files/create-leetcode.py "$1" "$2") && echo "$output" | xargs vim diff --git a/leetcode-submission.sh b/leetcode-submission.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# you could try using open instead of vim, but depending on the filetype +# you may run into issues. + +output=$(python3 ~/bin/python-files/create-leetcode.py "$1" "$2") && \ +echo "$output" | xargs vim && \ +dirname=$(echo "$output" | cut -d'/' -f1) && \ +formatted_name=$(echo "$dirname" | tr '-' ' ') && \ +git add . && \ +git commit -m "Completed $formatted_name" && \ +git push diff --git a/python-files/create-leetcode.py b/python-files/create-leetcode.py @@ -17,11 +17,6 @@ import sys # -> PROBLEM-NAMEV2.py # -> PROBLEM-NAMEVN.py -# NOTE: -# the file names are truncated versions of the -# problem name for simplicity sake. These are limited to -# 10 characters + the V extension and file extension. - def create_directory(problem_name) -> str: os.makedirs(problem_name, exist_ok=True) return problem_name @@ -33,7 +28,7 @@ def get_file_name(problem_name, dir_name, extension : str): done = False count = 0 - problem_name = problem_name[:10] + # problem_name = problem_name[:10] while not done: