Skip to content

Commit

Permalink
♻️ refactor: updated codebase #4
Browse files Browse the repository at this point in the history
  • Loading branch information
pnguyen215 committed Jan 20, 2024
1 parent 5543b1d commit e04ff87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
16 changes: 8 additions & 8 deletions src/devops/github_go_ci.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# add_github_go_ci function
# github_add_go_ci function
# Add GitHub Actions workflow and changelog script for Go projects.

# Usage:
# add_github_go_ci
# github_add_go_ci

# Description:
# The 'add_github_go_ci' function downloads a GitHub Actions workflow file (ci.yml) and a Git changelog script,
# The 'github_add_go_ci' function downloads a GitHub Actions workflow file (ci.yml) and a Git changelog script,
# specifically designed for Go projects. It saves these files to the specified locations.

# Options:
# None

# Example usage:
# add_github_go_ci
# github_add_go_ci

# Instructions:
# 1. Run 'add_github_go_ci' to download the GitHub Actions workflow file and Git changelog script.
# 1. Run 'github_add_go_ci' to download the GitHub Actions workflow file and Git changelog script.
# 2. The workflow file (ci.yml) will be saved to the '$github_workflow_conf' directory.
# 3. The changelog script will be saved to the current directory.

# Notes:
# - Ensure that 'curl' is installed for proper functionality.
# - The URLs point to specific files in the 'wsdkit.keys' repository on GitHub.
function add_github_go_ci() {
download_file ".github/workflows/ci.yml" "https://raw.githubusercontent.com/pnguyen215/wsdkit.keys/master/devops/github_go_workflow.yml"
function github_add_go_ci() {
download_file ".github/workflows/ci.yml" "https://raw.githubusercontent.com/pnguyen215/wsdkit.keys/master/devops/github_workflow/ci.yml"
download_file "git_changelog.sh" "https://raw.githubusercontent.com/pnguyen215/wsdkit.keys/master/sh/git_changelog.sh"
}
alias addgithubgoci="add_github_go_ci"
alias addgithubgoci="github_add_go_ci"
4 changes: 1 addition & 3 deletions src/h.sh
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,6 @@ function download_file() {

# Check if the directory exists, create it if not
create_file_if_not_exists "$directory"
create_file_if_not_exists "$filename"

# Change to the directory to download the file
cd "$directory" || return 1
Expand All @@ -809,8 +808,7 @@ function download_file() {
fi

# Download the file
# wsd_exe_cmd curl -O "$link" -o "$filename"
wsd_exe_cmd curl -o "$filename" "$link"
wsd_exe_cmd curl -O "$link" -o "$filename"

if [ $? -eq 0 ]; then
echo "🍺 Downloaded successfully: $filename"
Expand Down

0 comments on commit e04ff87

Please sign in to comment.