Skip to content

Commit

Permalink
buck2: explain: remove src_join() syntax sugar
Browse files Browse the repository at this point in the history
Reviewed By: JakobDegen

Differential Revision: D68976719

fbshipit-source-id: a6c5a39953a1593a5d7b3fa892ecaee1393b3992
  • Loading branch information
iguridi authored and facebook-github-bot committed Feb 1, 2025
1 parent f84b423 commit 5982e0f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/buck2_explain/js/build_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,12 @@ def main():
args.src, tmp_src_path, dirs_exist_ok=True, copy_function=copy_writable
)

src_join = functools.partial(os.path.join, tmp_src_path)

env = {"YARN_YARN_OFFLINE_MIRROR": os.path.realpath(args.yarn_offline_mirror)}
run(
yarn
+ [
"--cwd",
src_join(),
tmp_src_path,
"install",
"--offline",
"--frozen-lockfile",
Expand All @@ -108,17 +106,17 @@ def main():
env=env,
)

rm_rf(src_join("dist"))
rm_rf(os.path.join(tmp_src_path, "dist"))

# build
run(yarn + ["--cwd", src_join(), "run", "build"], env={"CI": "false"})
run(yarn + ["--cwd", tmp_src_path, "run", "build"], env={"CI": "false"})

# inline js and css into html file
with open(src_join("dist/App.js"), "r") as f:
with open(os.path.join(tmp_src_path, "dist/App.js"), "r") as f:
js_content = f.read()
with open(src_join("dist/App.css"), "r") as f:
with open(os.path.join(tmp_src_path, "dist/App.css"), "r") as f:
css_content = f.read()
with open(src_join("index.html"), "r") as f:
with open(os.path.join(tmp_src_path, "index.html"), "r") as f:
html_content = f.read()

assert JS_SCRIPT in html_content
Expand Down

0 comments on commit 5982e0f

Please sign in to comment.