Skip to content

Commit

Permalink
fix(add-desk-page): react dependency at correct directory
Browse files Browse the repository at this point in the history
Fixes #26
  • Loading branch information
NagariaHussain committed Jan 14, 2025
1 parent be9023a commit bcbd11d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doppio/commands/desk_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ def setup_vue_desk_page_starter(page_doc, app_name):
def setup_react_desk_page_starter(page_doc, app_name):
# check if package.json exists in app directory
# if not, create package.json using npm init --yes
package_json_path = Path(frappe.get_app_path(app_name)) / "package.json"
app_path = Path("../apps") / app_name
package_json_path = app_path / "package.json"
if not package_json_path.exists():
subprocess.run(["npm", "init", "--yes"], cwd=frappe.get_app_path(app_name))
subprocess.run(["npm", "init", "--yes"], cwd=app_path)

# install react and react-dom
click.echo("Installing react and react-dom...")
subprocess.run(
["yarn", "add", "react", "react-dom"], cwd=frappe.get_app_path(app_name)
["yarn", "add", "react", "react-dom"], cwd=app_path
)

setup_desk_page_for_framework("react", page_doc, app_name)
Expand Down

0 comments on commit bcbd11d

Please sign in to comment.