Skip to content

Commit

Permalink
feat: create custom profile for each projects dev run at .profile
Browse files Browse the repository at this point in the history
  • Loading branch information
doc-han committed Oct 15, 2024
1 parent 252cf26 commit 931c5fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/create-xtensio-app/_template/javascript/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# xtensio
/.xtensio/
/zips/
/.profile/

# misc
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions packages/create-xtensio-app/_template/typescript/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# xtensio
/.xtensio/
/zips/
/.profile/

# misc
.DS_Store
Expand Down
7 changes: 6 additions & 1 deletion packages/xtensio/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ export async function xtensioCLI<T extends Commands>(
.filter((v: unknown) => typeof v === "string")
.map((v: string) => `--start-url ${v}`)
.join(" ")

const defaultProfile = path.join(cwd, "./.profile")
const profile: string = pkg.xtensio?.profile || defaultProfile
await devCommand(cwd)
const devPath = path.join(cwd, "./.xtensio/dev")
execute(
`${
isNpm ? "npx" : "yarn"
} web-ext run --source-dir ${devPath} --target=chromium --no-reload ${startUrls}`
} web-ext run --source-dir ${devPath} --target=chromium --no-reload ${startUrls} --keep-profile-changes ${
profile === defaultProfile ? "--profile-create-if-missing" : ""
} --chromium-profile="${profile}"`
)
return
default:
Expand Down

0 comments on commit 931c5fa

Please sign in to comment.