Skip to content

Commit c54d450

Browse files
authored
Simplify note-c subtree and add a script for updating it. (#122)
Prior to this commit, we were including everything from note-c. Now, we've removed all the unneeded subdirectories, most notably test/, which caused all sorts of problems because the Arduino build system has no way of ignoring folders. In the future, when note-c needs to be bumped, use scripts/upate_note_c.sh.
1 parent 00c87ab commit c54d450

File tree

152 files changed

+50
-30020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+50
-30020
lines changed

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Blues Wireless Notecard
2-
version=1.5.2
2+
version=1.5.3
33
author=Blues
44
maintainer=Blues <[email protected]>
55
sentence=An easy to use Notecard Library for Arduino.

scripts/update_note_c.sh

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
#
4+
# Update the note-c subtree.
5+
#
6+
# Usage: ./update_note_c.sh <note-c git ref>
7+
#
8+
# The note-c git ref argument is optional. If not specified, the master branch
9+
# will be used.
10+
#
11+
12+
# Exit script if any command fails.
13+
set -e
14+
15+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
16+
ROOT_DIR="$SCRIPT_DIR/.."
17+
18+
# Optional argument to specify the note-c ref to check out when creating the
19+
# subtree.
20+
if [ $# -eq 0 ]; then
21+
REF="master"
22+
else
23+
REF="$1"
24+
fi
25+
26+
# Move to the root of note-arduino.
27+
pushd $ROOT_DIR
28+
# Remove the existing note-c directory.
29+
rm -rf src/note-c
30+
# Commit the changes so that the next git subtree command doesn't complain about
31+
# changes in the working tree.
32+
git commit -am 'remove note-c before re-add'
33+
# Check out the note-c subtree using the given ref or master if not specified.
34+
git subtree add --prefix=src/note-c --squash https://github.com/blues/note-c.git $REF
35+
36+
# Remove all the unneeded directories from the subtree.
37+
NOTE_C_DIR="$ROOT_DIR/src/note-c"
38+
NOTE_C_UNNEEDED_DIRS=(
39+
"$NOTE_C_DIR/assets"
40+
"$NOTE_C_DIR/docs"
41+
"$NOTE_C_DIR/scripts"
42+
"$NOTE_C_DIR/test"
43+
)
44+
for DIR in "${NOTE_C_UNNEEDED_DIRS[@]}"; do
45+
rm -rf "$DIR"
46+
done
47+
48+
# Return to original directory.
49+
popd
-4.74 KB
Binary file not shown.

src/note-c/docs/CMakeLists.txt

-26
This file was deleted.

0 commit comments

Comments
 (0)