Skip to content

Commit

Permalink
set vs code word wrap and git changes func
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrarimarco committed Aug 26, 2024
1 parent 4fbad5f commit 3d25da0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions .config/Code/User/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
],
"editor.suggest.insertMode": "replace",
"editor.tabSize": 2,
"editor.wordWrap": "off",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"files.associations": {
Expand Down
15 changes: 15 additions & 0 deletions .shells/.all/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -531,3 +531,18 @@ reload_udev_rules_and_trigger() {
udevadm control --reload-rules
udevadm trigger
}

check_git_working_directory_changes() {
GIT_REPOSITORY_PATH="${1:-$(pwd)}"
# Check if there are unexpected changes in the working directory:
# - Unstaged changes
# - Changes that are staged but not committed
# - Untracked files and directories
if ! git -C "${GIT_REPOSITORY_PATH}" diff --exit-code --quiet ||
! git -C "${GIT_REPOSITORY_PATH}" diff --cached --exit-code --quiet ||
! git -C "${GIT_REPOSITORY_PATH}" ls-files --others --exclude-standard --directory; then
echo "There are unexpected changes in the working directory of the ${GIT_REPOSITORY_PATH} Git repository."
git -C "${GIT_REPOSITORY_PATH}" status
return 1
fi
}

0 comments on commit 3d25da0

Please sign in to comment.