Skip to content

Instantly share code, notes, and snippets.

{
"version": "2.0.0",
"tasks": [
{
"label": "Run My Shell Script",
"type": "shell",
"workingDirectory": "${workspaceFolder}",
"command": "./shell/vscode_onsave.sh",
"problemMatcher": [],
"group": {
#!/bin/bash
echo "✅pre-push hook start at $(date)"
start_time=$(date +%s)
echo "🎉pre-push hook end at $(date) elapsed $(($(date +%s) - $start_time)) seconds"
#!/bin/bash
source .env
source ./shell/logger.sh
log "✅post-push hook start at $(date)"
start_time=$(date +%s)
log "🎉post-push hook end at $(date) elapsed $(($(date +%s) - $start_time)) seconds"
#!/bin/bash
echo "✅post-commit hook start at $(date)"
start_time=$(date +%s)
# 查看环境变量
source .env
echo "👁️build_version: $build_version"
echo "👁️build_time: $build_time"
#!/bin/bash
echo "✅post-push hook start at $(date)"
start_time=$(date +%s)
echo "🎉post-push hook end at $(date) elapsed $(($(date +%s) - $start_time)) seconds"
#!/bin/bash
echo "✅pre-push hook start at $(date)"
start_time=$(date +%s)
echo "🎉pre-push hook end at $(date) elapsed $(($(date +%s) - $start_time)) seconds"
#!/bin/bash
echo "✅post-commit hook start at $(date)"
start_time=$(date +%s)
# 查看环境变量
source .env
echo "👁️build_version: $build_version"
echo "👁️build_time: $build_time"
#!/bin/bash
echo "✅pre-commit hook start at $(date)"
start_time=$(date +%s)
# 添加环境变量
source .env
echo "👁️build_version: $build_version"
echo "👁️build_time: $build_time"
# 将环境变量的第三位加1
#!/bin/bash
echo "✅post-commit hook start at $(date)"
start_time=$(date +%s)
# 查看环境变量
source .env
echo "👁️build_version: $build_version"
echo "👁️build_time: $build_time"
#!/bin/bash
echo "✅pre-commit hook start at $(date)"
start_time=$(date +%s)
# 添加环境变量
source .env
echo "👁️build_version: $build_version"
echo "👁️build_time: $build_time"
# 将环境变量的第三位加1
build_version=$(echo $build_version | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')