Skip to content

Commit

Permalink
fix initial value
Browse files Browse the repository at this point in the history
  • Loading branch information
ieedan committed Nov 15, 2024
1 parent 4e51cb4 commit a3422b9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions sites/docs/src/lib/components/docs/pm-block.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
const selectedPackageManager = getPackageManager();
function getCmd(pm: Agent, type: Props["type"]): ResolvedCommand {
// ssr
if (pm === undefined) pm = "npm";
let args = [];
if (typeof command === "string") {
args = command.split(" ");
Expand Down
2 changes: 1 addition & 1 deletion sites/docs/src/lib/stores/package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Agent } from "package-manager-detector";

const PACKAGE_MANAGER = Symbol("packageManager");

export function setPackageManager(initialValue: Agent) {
export function setPackageManager(initialValue: Agent = "npm") {
const packageManager = createPackageManagerStore("packageManager", initialValue);
setContext(PACKAGE_MANAGER, packageManager);
return packageManager;
Expand Down

0 comments on commit a3422b9

Please sign in to comment.