-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RSDK-8303: get and send versions (#689)
- Loading branch information
1 parent
604cbac
commit 211d7ac
Showing
4 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import re | ||
import sys | ||
|
||
|
||
def update_version(file_path: str, new_version: str): | ||
with open(file_path, "r") as file: | ||
data = file.read() | ||
|
||
data = re.sub(r'(API_VERSION\s*=\s*)"[0-9]+\.[0-9]+\.[0-9]+"', f'\\1"{new_version}"', data) | ||
|
||
with open(file_path, 'w') as file: | ||
file.write(data) | ||
|
||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) != 3: | ||
print("Usage: python3 etc/update_version.py <file_path> <new_version>") | ||
sys.exit(1) | ||
|
||
update_version(sys.argv[1], sys.argv[2]) |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import viam | ||
|
||
API_VERSION = "0.1.327" | ||
SDK_VERSION = viam.__version__ |