Compare commits
10 Commits
5ffc6e922d
...
awesome-cv
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48775c8b9a | ||
|
|
ed1e7e1778 | ||
|
|
9a410226b3 | ||
|
|
1e28e0ce7c | ||
|
|
3a6daf63dd | ||
|
|
2c58ebe28a | ||
|
|
35e9e3ae5a | ||
|
|
b15d162916 | ||
|
|
17f242fb39 | ||
|
|
88652088e4 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,5 +9,6 @@
|
|||||||
!*.tex
|
!*.tex
|
||||||
!*.pdf
|
!*.pdf
|
||||||
!*.jpg
|
!*.jpg
|
||||||
|
!*.md
|
||||||
!build/*.*
|
!build/*.*
|
||||||
|
|
||||||
|
|||||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -16,5 +16,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"latex-workshop.latex.recipe.default": "Smart LaTeX Build",
|
"latex-workshop.latex.recipe.default": "Smart LaTeX Build",
|
||||||
"latex-workshop.formatting.latex": "latexindent"
|
"latex-workshop.formatting.latex": "latexindent",
|
||||||
|
"latex-workshop.latex.autoBuild.run": "onSave"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,5 +13,11 @@ Go to https://tug.org/texlive/ and install the correct TeX for your operating sy
|
|||||||
|
|
||||||
If you are using VS Code, I highly recommend to install [LaTeX Workshop](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop).
|
If you are using VS Code, I highly recommend to install [LaTeX Workshop](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop).
|
||||||
|
|
||||||
|
## Other CV variants
|
||||||
|
|
||||||
|
- [Article](../article/)
|
||||||
|
- [ModernCV](../moderncv)
|
||||||
|
- [Pedro-CV](../pedro-cv/)
|
||||||
|
|
||||||
##
|
##
|
||||||
Developed with ♥ by Pedro Pessoa Cabral
|
Developed with ♥ by Pedro Pessoa Cabral
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ FILE="$1"
|
|||||||
# append .tex file extension, iff not already passed
|
# append .tex file extension, iff not already passed
|
||||||
[[ "$FILE" != *.tex ]] && FILE="${FILE}.tex"
|
[[ "$FILE" != *.tex ]] && FILE="${FILE}.tex"
|
||||||
|
|
||||||
|
# remove the .tex extension from the file name to get the base name
|
||||||
|
BASE="${FILE%.tex}"
|
||||||
|
|
||||||
# Check that the file exists
|
# Check that the file exists
|
||||||
if [[ ! -f "$FILE" ]]; then
|
if [[ ! -f "$FILE" ]]; then
|
||||||
echo -e "${BOLD}${RED}Error${RESET}${RED}: File '$FILE' not found.${RESET}"
|
echo -e "${BOLD}${RED}Error${RESET}${RED}: File '$FILE' not found.${RESET}"
|
||||||
@@ -28,8 +31,24 @@ fi
|
|||||||
# Detect active \usepackage{fontspec} (ignore commented lines)
|
# Detect active \usepackage{fontspec} (ignore commented lines)
|
||||||
if grep -Eq '^[^%]*\\usepackage\{fontspec\}' "$FILE"; then
|
if grep -Eq '^[^%]*\\usepackage\{fontspec\}' "$FILE"; then
|
||||||
echo -e "${BLUE}Detected fontspec → Using XeLaTeX${RESET}"
|
echo -e "${BLUE}Detected fontspec → Using XeLaTeX${RESET}"
|
||||||
xelatex -synctex=1 -interaction=nonstopmode -file-line-error "$FILE"
|
LATEX_CMD=(xelatex -synctex=1 -interaction=nonstopmode -file-line-error "$FILE")
|
||||||
else
|
else
|
||||||
echo -e "${BLUE}No active fontspec → Using pdfLaTeX${RESET}"
|
echo -e "${BLUE}No active fontspec → Using pdfLaTeX${RESET}"
|
||||||
pdflatex -synctex=1 -interaction=nonstopmode -file-line-error "$FILE"
|
LATEX_CMD=(pdflatex -synctex=1 -interaction=nonstopmode -file-line-error "$FILE")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
"${LATEX_CMD[@]}"
|
||||||
|
|
||||||
|
rm -f \
|
||||||
|
"${BASE}.aux" \
|
||||||
|
"${BASE}.bbl" \
|
||||||
|
"${BASE}.bcf" \
|
||||||
|
"${BASE}.blg" \
|
||||||
|
"${BASE}.fdb_latexmk" \
|
||||||
|
"${BASE}.fls" \
|
||||||
|
"${BASE}.log" \
|
||||||
|
"${BASE}.out" \
|
||||||
|
"${BASE}.run.xml" \
|
||||||
|
"${BASE}.synctex.gz" \
|
||||||
|
"${BASE}.toc" \
|
||||||
|
"${BASE}.xdv"
|
||||||
|
|||||||
96
build/propagate-commit-to-branches.sh
Executable file
96
build/propagate-commit-to-branches.sh
Executable file
@@ -0,0 +1,96 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Color definitions
|
||||||
|
BOLD='\033[1m'
|
||||||
|
RED='\033[31m'
|
||||||
|
BLUE='\033[34m'
|
||||||
|
GREEN='\033[32m'
|
||||||
|
YELLOW='\033[33m'
|
||||||
|
RESET='\033[0m'
|
||||||
|
|
||||||
|
if [[ $# -ne 1 ]]; then
|
||||||
|
echo -e "${BOLD}${RED}Error${RESET}${RED}: No commit hash provided.${RESET}"
|
||||||
|
echo "Usage: $0 <commit-hash>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
COMMIT="$1"
|
||||||
|
START_BRANCH="$(git branch --show-current)"
|
||||||
|
|
||||||
|
if [[ -z "$START_BRANCH" ]]; then
|
||||||
|
echo -e "${BOLD}${RED}Error${RESET}${RED}: Detached HEAD is not supported.${RESET}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! git rev-parse --verify --quiet "${COMMIT}^{commit}" >/dev/null; then
|
||||||
|
echo -e "${BOLD}${RED}Error${RESET}${RED}: Commit '$COMMIT' not found.${RESET}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
COMMIT="$(git rev-parse --short "$COMMIT")"
|
||||||
|
COMMIT_MSG="$(git log -1 --pretty=format:%s "$COMMIT")"
|
||||||
|
PARENT_COUNT="$(git rev-list --parents -n 1 "$COMMIT" | wc -w | tr -d ' ')"
|
||||||
|
|
||||||
|
if [[ "$PARENT_COUNT" -gt 2 ]]; then
|
||||||
|
echo -e "${BOLD}${RED}Error${RESET}${RED}: Merge commits are not supported.${RESET}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "$(git status --porcelain)" ]]; then
|
||||||
|
echo -e "${BOLD}${RED}Error${RESET}${RED}: Working tree is not clean.${RESET}"
|
||||||
|
echo "Commit, stash, or discard local changes before replicating a commit."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
restore_branch() {
|
||||||
|
git switch --quiet "$START_BRANCH"
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_error() {
|
||||||
|
echo -e "${BOLD}${RED}Error${RESET}${RED}: Replication failed on branch '$(git branch --show-current)'.${RESET}"
|
||||||
|
|
||||||
|
if [[ -f "$(git rev-parse --git-path CHERRY_PICK_HEAD 2>/dev/null || true)" ]]; then
|
||||||
|
git cherry-pick --abort >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
restore_branch
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
trap handle_error ERR
|
||||||
|
|
||||||
|
echo -e "${BLUE}Propagating commit ${BOLD}'${COMMIT}: ${COMMIT_MSG}'${RESET}${BLUE} from '${START_BRANCH}' to local branches.${RESET}"
|
||||||
|
|
||||||
|
while IFS= read -r BRANCH; do
|
||||||
|
if [[ "$BRANCH" == "$START_BRANCH" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
git switch --quiet "$BRANCH"
|
||||||
|
|
||||||
|
if git merge-base --is-ancestor "$COMMIT" HEAD; then
|
||||||
|
echo -e "${YELLOW}Skipping ${BRANCH}: commit is already present.${RESET}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${BLUE}Cherry-picking ${COMMIT} onto ${BRANCH}.${RESET}"
|
||||||
|
if ! git cherry-pick "$COMMIT"; then
|
||||||
|
if git diff --quiet && git diff --cached --quiet; then
|
||||||
|
echo -e "${YELLOW}Skipping ${BRANCH}: commit is already applied as an equivalent patch.${RESET}"
|
||||||
|
git cherry-pick --skip
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${GREEN}Commit successfully cherry-picked to ${BRANCH}.${RESET}"
|
||||||
|
git push
|
||||||
|
echo -e "${GREEN}Branch ${BRANCH} successfully pushed.${RESET}"
|
||||||
|
|
||||||
|
done < <(git for-each-ref --format='%(refname:short)' refs/heads)
|
||||||
|
|
||||||
|
restore_branch
|
||||||
|
|
||||||
|
echo -e "${GREEN}Done. Returned to '${START_BRANCH}'.${RESET}"
|
||||||
Reference in New Issue
Block a user