-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finally integrate various features and fixes from inkarkat
Merge pull request #405 from inkarkat/master
- Loading branch information
Showing
16 changed files
with
227 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,48 @@ | ||
#!/bin/bash | ||
|
||
make_action() | ||
make_dummy_action() | ||
{ | ||
unset TODO_ACTIONS_DIR | ||
[ -d .todo.actions.d ] || mkdir .todo.actions.d | ||
cat > ".todo.actions.d/$1" <<EOF | ||
local actionName; actionName="$(basename "${1:?}")" | ||
cat > "$1" <<EOF | ||
#!/bin/bash | ||
[ "\$1" = "usage" ] && { | ||
echo " $1 ITEM#[, ITEM#, ...] [TERM...]" | ||
echo " This custom action does $1." | ||
echo " $actionName ITEM#[, ITEM#, ...] [TERM...]" | ||
echo " This custom action does $actionName." | ||
echo "" | ||
exit | ||
} | ||
echo "custom action $1" | ||
echo "custom action $actionName$2" | ||
EOF | ||
chmod +x ".todo.actions.d/$1" | ||
chmod +x "$1" | ||
} | ||
|
||
make_action() | ||
{ | ||
unset TODO_ACTIONS_DIR | ||
[ -d .todo.actions.d ] || mkdir .todo.actions.d | ||
[ -z "$1" ] || make_dummy_action ".todo.actions.d/$1" | ||
} | ||
|
||
make_action_in_folder() | ||
{ | ||
unset TODO_ACTIONS_DIR | ||
[ -d .todo.actions.d ] || mkdir .todo.actions.d | ||
mkdir ".todo.actions.d/$1" | ||
cat > ".todo.actions.d/$1/$1" <<EOF | ||
#!/bin/bash | ||
[ "\$1" = "usage" ] && { | ||
echo " $1 ITEM#[, ITEM#, ...] [TERM...]" | ||
echo " This custom action does $1." | ||
echo "" | ||
exit | ||
[ -z "$1" ] || make_dummy_action ".todo.actions.d/$1/$1" "in folder $1" | ||
} | ||
echo "custom action $1 in folder $1" | ||
EOF | ||
chmod +x ".todo.actions.d/$1/$1" | ||
|
||
invalidate_action() | ||
{ | ||
local customActionFilespec="${1:?}"; shift | ||
local testName="${1:?}"; shift | ||
|
||
chmod -x "$customActionFilespec" | ||
# On Cygwin, clearing the executable flag may have no effect, as the Windows | ||
# ACL may still grant execution rights. In this case, we skip the test, and | ||
# remove the (still valid) custom action so that it doesn't break following | ||
# tests. | ||
if [ -x "$customActionFilespec" ]; then | ||
SKIP_TESTS="${SKIP_TESTS}${SKIP_TESTS+ }${testName}" | ||
rm -- "$customActionFilespec" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.