Skip to content

Commit

Permalink
Remove neglected
Browse files Browse the repository at this point in the history
We shouldn't need this since we sync for various pkg-not-found situations.

Closes #73
Closes pkgxdev/pkgx#1021
  • Loading branch information
mxcl committed Sep 5, 2024
1 parent 9edf3d4 commit 0c0f3ce
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
8 changes: 0 additions & 8 deletions src/hooks/usePantry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,6 @@ export default function usePantry() {
}
}

const neglected = () => {
if (!prefix.exists()) return true
const stat = Deno.statSync(prefix.string)
if (!stat.mtime) return true
return (Date.now() - stat.mtime.getTime()) > 24 * 60 * 60 * 1000
}

return {
prefix,
which,
Expand All @@ -276,7 +269,6 @@ export default function usePantry() {
parse_pkgs_node,
expand_env_obj,
missing,
neglected,
pantry_paths
}

Expand Down
2 changes: 1 addition & 1 deletion src/porcelain/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default async function(pkgs: PackageSpecification[] | string[] | string,

const pantry = usePantry()

if (pantry.missing() || pantry.neglected()) {
if (pantry.missing()) {
await useSync()
}

Expand Down
2 changes: 1 addition & 1 deletion src/porcelain/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function setup(cmd: string, env: Record<string, string | undefined>, logge
const sh = useShellEnv()
const { install, link } = _internals

if (pantry.missing() || pantry.neglected()) {
if (pantry.missing()) {
await useSync()
}

Expand Down

0 comments on commit 0c0f3ce

Please sign in to comment.