Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Commit

Permalink
Fix bug (#27)
Browse files Browse the repository at this point in the history
close #27
  • Loading branch information
SanmerDev committed Aug 30, 2023
1 parent da43c8f commit 7cbae9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 41 deletions.
38 changes: 2 additions & 36 deletions sync/__version__.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,9 @@
from pathlib import Path

from .utils import GitUtils

GitUtils.set_cwd_folder(Path(__file__).resolve().parent)


def get_base_version() -> str:
return "2.0.0"


def get_base_version_code() -> int:
return 200


def is_dev_version() -> bool:
if not GitUtils.is_enable():
return False

return not GitUtils.has_tag(f"v{get_base_version()}")


def get_version() -> str:
if GitUtils.is_enable():
suffix = f".{GitUtils.commit_id()}"
if is_dev_version():
suffix += ".dev"
else:
suffix = ""

return get_base_version() + suffix
return "2.0.0"


def get_version_code() -> int:
if GitUtils.is_enable():
count = int(GitUtils.commit_count())
else:
count = 0

return get_base_version_code() + count
return 200


__all__ = [
Expand Down
5 changes: 0 additions & 5 deletions sync/core/Index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from .Config import Config
from .Sync import Sync
from ..__version__ import get_version, get_version_code
from ..error import Result
from ..model import (
AttrDict,
Expand Down Expand Up @@ -37,10 +36,6 @@ def _add_modules_json_0(self, track, update_json, online_module):
self.modules_json = ModulesJson(
name=self._config.name,
timestamp=datetime.now().timestamp(),
metadata=AttrDict(
version=get_version(),
versionCode=get_version_code()
),
modules=list()
)

Expand Down

0 comments on commit 7cbae9e

Please sign in to comment.