-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* interoperable sed command * add gitignore/editorconfig files * improved logging in weekly hours calculator * improved logging in the daily entry creation script
- Loading branch information
1 parent
def4cc2
commit 21402cb
Showing
7 changed files
with
36 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*.md] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
insert_final_newline = false | ||
trim_trailing_whitespace = true |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.DS_STORE | ||
.vscode | ||
todo.txt.bak |
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,26 +1,30 @@ | ||
#!/bin/bash | ||
|
||
echo "MAKING DAILY ENTRY" | ||
|
||
DATE=$(date +%Y-%m-%d) | ||
WEEKLYDIRECTORY="docs/daily/week-of_${DATE}" | ||
|
||
TODAY=$(date) | ||
if [[ $TODAY == Mon* ]] && [ ! -d ${WEEKLYDIRECTORY} ]; then | ||
mkdir $WEEKLYDIRECTORY | ||
echo $WEEKLYDIRECTORY dir created | ||
echo $WEEKLYDIRECTORY dir created. | ||
fi | ||
|
||
ACTIVEWEEK=$(ls -l docs/daily | tail -1 | awk '{ print $10 }') | ||
FILENAME="docs/daily/${ACTIVEWEEK}/${DATE}-todo.md" | ||
ACTIVEWEEK=$(ls -1A docs/daily | tail -1) | ||
FILENAME=${DATE}-todo.md | ||
FILE_PATH="docs/daily/${ACTIVEWEEK}/${FILENAME}" | ||
|
||
if [ ! -f ${FILENAME} ]; then | ||
if [ ! -f ${FILE_PATH} ]; then | ||
# make new daily entry | ||
cp templates/daily-template.md ${FILENAME} | ||
cp templates/daily-template.md ${FILE_PATH} | ||
echo $FILE_PATH file created. | ||
# add header to daily entry | ||
sed -i '' "1s/^/# ${DATE} TODO \n/" ${FILENAME} | ||
echo $FILENAME created. | ||
sed -i.bak "1s/^/# ${DATE} TODO \n/" ${FILE_PATH} | ||
# For backwards compatibility between GNU and BSD version of sed | ||
rm ${FILE_PATH}.bak | ||
echo Opening new daily entry: $FILENAME | ||
else | ||
echo Opening existing daily entry: $FILENAME | ||
fi | ||
|
||
# open in vscode editor | ||
code $FILENAME | ||
code $FILE_PATH |
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,10 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# script to replace all instances of this regex (?<!\[)(KEY-(\d){4,5})(?!\)) with [$0](https://mycompany.atlassian.net/browse/$0) in file passed as argument | ||
# Replace "KEY" with your Jira project key | ||
# Replaces matching story numbers in specified file(s) with a markdown link to Jira | ||
|
||
# update script to run perl command for all arguments passed to script | ||
for i in "$@" | ||
do | ||
# NOTE: Replace "KEY" with your Jira project key | ||
perl -pi -e 's/(?<!\[)(KEY-(\d){4,5})(?!\))/[$1](https:\/\/mycompany.atlassian.net\/browse\/$1)/g' $i | ||
done |
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,3 +1,4 @@ | ||
|
||
## Hours | ||
|
||
in @ | ||
|
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,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
ACTIVEWEEK=$(ls -l docs/daily | tail -1 | awk '{ print $10 }') | ||
ACTIVEWEEK=$(ls -1A docs/daily | tail -1) | ||
|
||
echo "ADDING WEEKLY HOURS: ${ACTIVEWEEK}" | ||
|
||
awk '/hours/' docs/daily/${ACTIVEWEEK}/* | awk 'sum+=$1; END{print sum " hours total"}' | ||
awk '/hours/' docs/daily/${ACTIVEWEEK}/* | awk 'BEGIN{sum=0}; sum+=$1; END{print sum " hours total"}' |