Skip to content

Commit

Permalink
fix: Archived app naming, apps.txt sync
Browse files Browse the repository at this point in the history
* apps.txt wasn't being synced in time so the build was failing, this
  changes that
* Apps archived on the same day weren't being numbered properly...it
  went from _1 to _1_2 and so forth. This is fixed to show _1, _2 and so
  on
  • Loading branch information
gavindsouza committed Nov 13, 2021
1 parent c636c7c commit 79980c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 6 additions & 7 deletions bench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ def get_archived_app_name():
dt = f"{self.repo}-{datetime.date.today()}"
if os.path.exists(os.path.join("archived", "apps", dt)):
for num in range(1, 100):
dt = f"{dt}_{num}"
if not os.path.exists(os.path.join("archived", "apps", dt)):
return dt
_dt = f"{dt}_{num}"
if not os.path.exists(os.path.join("archived", "apps", _dt)):
return _dt
return dt

src = os.path.join("apps", self.repo)
Expand Down Expand Up @@ -304,7 +304,6 @@ def get_app(

app.get()
app.install(verbose=verbose, skip_assets=skip_assets)
bench.apps.sync()


def new_app(app, bench_path="."):
Expand Down Expand Up @@ -341,10 +340,10 @@ def install_app(
if os.path.exists(os.path.join(app_path, "package.json")):
exec_cmd("yarn install", cwd=app_path)

add_to_appstxt(app, bench_path=bench_path)

conf = Bench(bench_path).conf
bench = Bench(bench_path)
bench.apps.sync()

conf = bench.conf
if conf.get("developer_mode"):
from bench.utils.bench import install_python_dev_dependencies

Expand Down
2 changes: 0 additions & 2 deletions bench/utils/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ def init(
if apps_path:
install_apps_from_path(apps_path, bench_path=path)

bench.apps.sync()

if not skip_assets:
build_assets(bench_path=path)

Expand Down

0 comments on commit 79980c3

Please sign in to comment.