Skip to content

Commit

Permalink
Closes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
sblantipodi committed May 28, 2020
1 parent 416bb65 commit 6afffab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ In the `Version.h` file (which you'll need to include in order to access the inc
```
use variables as you desire.

Note: This script does not check for a successfull upload, in the case of an upload failure, please discard the increment manually.

## License
This program is licensed under MIT License
9 changes: 8 additions & 1 deletion version_increment.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@

import sys
import datetime
import os

## DO NOT EDIT THIS FILE, edit version file if you want to start from a different version
BUILD_NUMBER = 'version'
VERSION_FILE = 'include/Version.h'
VERSION_FILE = 'Version.h'
version = '0.1.'

## Increment version during the upload stage only
Expand Down Expand Up @@ -61,6 +62,12 @@
#define BUILD_TIMESTAMP "{}"
#endif
""".format(version + str(build_no), datetime.datetime.now(), version+str(build_no))

if (os.environ.get('PLATFORMIO_INCLUDE_DIR') != None):
VERSION_FILE = os.environ.get('PLATFORMIO_INCLUDE_DIR') + "/" + VERSION_FILE
elif os.path.exists("include"):
VERSION_FILE = "include/" + VERSION_FILE

with open(VERSION_FILE, 'w+') as f:
f.write(hf)
else:
Expand Down

0 comments on commit 6afffab

Please sign in to comment.