From 3ccd5065b5f8e97a00aae4f10c2ca2e7e1559e5f Mon Sep 17 00:00:00 2001 From: Nikurasu Date: Mon, 27 Nov 2023 10:43:47 +0100 Subject: [PATCH] feat(Shell): Add Scripts Add FFMPEG and git commit scripts --- mergeFFMPEG.sh | 26 ++++++++++++++++++++++++++ shell/scripts/gitCommit.sh | 13 +++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 mergeFFMPEG.sh create mode 100755 shell/scripts/gitCommit.sh diff --git a/mergeFFMPEG.sh b/mergeFFMPEG.sh new file mode 100755 index 0000000..33ae415 --- /dev/null +++ b/mergeFFMPEG.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Assign the first command line argument to the variable video_source +video_source="$1" + +# Assign the second command line argument to the variable audio_source +audio_source="$2" + +# Assign the third command line argument to the variable output_file +output_file="$3" + +# Check if all arguments are provided +if [ "$#" -ne 3 ]; then + echo "Usage: $0 video_source audio_source output_file" + exit 1 +fi + +# Use ffmpeg to merge the video and audio files +ffmpeg -i "$video_source" -i "$audio_source" -c:v copy -c:a copy -strict experimental "$output_file" + +# Check if ffmpeg succeeded +if [ $? -eq 0 ]; then + echo "Merging completed successfully." +else + echo "An error occurred during merging." +fi \ No newline at end of file diff --git a/shell/scripts/gitCommit.sh b/shell/scripts/gitCommit.sh new file mode 100755 index 0000000..dfbfa92 --- /dev/null +++ b/shell/scripts/gitCommit.sh @@ -0,0 +1,13 @@ +#!/bin/sh +TYPE=$(gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert") +SCOPE=$(gum input --placeholder "scope") + +# Since the scope is optional, wrap it in parentheses if it has a value. +test -n "$SCOPE" && SCOPE="($SCOPE)" + +# Pre-populate the input with the type(scope): so that the user may change it +SUMMARY=$(gum input --value "$TYPE$SCOPE: " --placeholder "Summary of this change") +DESCRIPTION=$(gum write --placeholder "Details of this change (CTRL+D to finish)") + +# Commit these changes +gum confirm "Commit changes?" && git commit -a -m "$SUMMARY" -m "$DESCRIPTION" \ No newline at end of file