-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
81 additions
and
58 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
[fit_properties] | ||
tag_name = 2.0.1 | ||
tag_name = v.2.0.1 | ||
check_connection_url = http://google.com | ||
npcap_latest_version_url = https://api.github.com/repos/nmap/npcap/releases/latest | ||
npcap_installer_url = https://npcap.com/dist/ | ||
pec_providers_url = https://www.agid.gov.it/it/piattaforme/posta-elettronica-certificata/elenco-gestori-pec | ||
fit_latest_version_url = https://api.github.com/repos/fit-project/fit/releases/latest | ||
fit_latest_version_url = https://api.github.com/repos/fit-project/fit/releases/latest | ||
|
This file was deleted.
Oops, something went wrong.
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,65 @@ | ||
import subprocess | ||
import re | ||
from configparser import ConfigParser | ||
|
||
|
||
def get_version_from_latest_git_tag(): | ||
try: | ||
tag = subprocess.check_output( | ||
["git", "describe", "--tags", "--abbrev=0"] | ||
).strip() | ||
return tag.decode("utf-8") | ||
except subprocess.CalledProcessError: | ||
return None | ||
|
||
|
||
def get_version_from_pyproject(): | ||
try: | ||
with open("pyproject.toml", "r") as file: | ||
for line in file: | ||
match = re.match(r'^\s*version\s*=\s*"(.*?)"\s*$', line) | ||
if match: | ||
return match.group(1) | ||
return None | ||
except FileNotFoundError: | ||
return None | ||
|
||
|
||
def get_version(): | ||
version = get_version_from_latest_git_tag() | ||
if version is None: | ||
version = get_version_from_pyproject() | ||
return version | ||
|
||
|
||
def update_version_in_pyproject_toml(): | ||
with open("pyproject.toml", "r") as file: | ||
content = file.read() | ||
new_content = re.sub( | ||
r'version\s*=\s*"[0-9a-zA-Z.-]+"', f'version = "{VERSION}"', content | ||
) | ||
|
||
with open("pyproject.toml", "w") as file: | ||
file.write(new_content) | ||
|
||
|
||
def update_version_in_config_ini(): | ||
config = ConfigParser() | ||
config.read("assets/config.ini") | ||
|
||
if config.has_section("fit_properties"): | ||
config.set("fit_properties", "tag_name", VERSION) | ||
|
||
with open("assets/config.ini", "w") as configfile: | ||
config.write(configfile) | ||
|
||
|
||
def update_version(): | ||
update_version_in_pyproject_toml() | ||
update_version_in_config_ini() | ||
|
||
|
||
VERSION = get_version() | ||
|
||
if VERSION is not None: | ||
update_version() |
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,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "fit" | ||
version = "2.0.1" | ||
version = "v.2.0.1" | ||
description = "FIT is a Python3 application for forensic acquisition of contents like web pages, emails, social media, etc. directly from the internet." | ||
authors = ["Fit Project <[email protected]>"] | ||
license = "GPL-3.0-only" | ||
|
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
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
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
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
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
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