Skip to content

Commit

Permalink
SlackStatus, PostToSlack: Switch python for macOS 12.3 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka authored May 30, 2022
1 parent efcdc42 commit 84da531
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/post-to-slack/default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ else
fi

function escape_for_json(){
echo -n "$1" | python -c 'import json,sys; print json.dumps(sys.stdin.read())'
py=$(command -v python3 || command -v python)
echo -n "$1" | $py -c 'import json,sys; print(json.dumps(sys.stdin.read()))'
}

USERNAME=$(escape_for_json "$KMPARAM_Username")
Expand Down
3 changes: 2 additions & 1 deletion src/set-slack-status/default.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

function escape_for_json(){
echo -n "$1" | python -c 'import json,sys; print json.dumps(sys.stdin.read())'
py=$(command -v python3 || command -v python)
echo -n "$1" | $py -c 'import json,sys; print(json.dumps(sys.stdin.read()))'
}

emoji=$(escape_for_json "$KMPARAM_Status_emoji")
Expand Down

0 comments on commit 84da531

Please sign in to comment.