Skip to content

Commit

Permalink
fix: minor fixes on package.json checks
Browse files Browse the repository at this point in the history
  • Loading branch information
charlypoly committed Sep 8, 2023
1 parent d3d6e97 commit 75399bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/defer-rw-setup/src/cron/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getPaths, writeFile } from "@redwoodjs/cli-helpers";
import type { FunctionOptions } from "./command";

export const tasks = (options: FunctionOptions) => {
const PACKAGE_JSON_PATH = path.join(getPaths().base, "package.json");
const PACKAGE_JSON_PATH = path.join(getPaths().api.base, "package.json");
const SRC_DEFER_PATH = path.join(getPaths().api.src, "jobs", "defer");
const SRC_DEFER_CLIENT_PATH_FILE = path.join(
getPaths().api.src,
Expand All @@ -30,7 +30,7 @@ export const tasks = (options: FunctionOptions) => {
const pkg = JSON.parse(fs.readFileSync(PACKAGE_JSON_PATH, "utf-8"));

if (
!pkg.dependencies.includes("@defer/client") ||
!(pkg.dependencies || {}).includes("@defer/client") ||
!fs.existsSync(SRC_DEFER_CLIENT_PATH_FILE)
) {
throw new Error(
Expand Down
4 changes: 2 additions & 2 deletions packages/defer-rw-setup/src/function/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getPaths, writeFile } from "@redwoodjs/cli-helpers";
import type { FunctionOptions } from "./command";

export const tasks = (options: FunctionOptions) => {
const PACKAGE_JSON_PATH = path.join(getPaths().base, "package.json");
const PACKAGE_JSON_PATH = path.join(getPaths().api.base, "package.json");
const SRC_DEFER_PATH = path.join(getPaths().api.src, "jobs", "defer");
const SRC_DEFER_CLIENT_PATH_FILE = path.join(
getPaths().api.src,
Expand All @@ -30,7 +30,7 @@ export const tasks = (options: FunctionOptions) => {
const pkg = JSON.parse(fs.readFileSync(PACKAGE_JSON_PATH, "utf-8"));

if (
!pkg.dependencies.includes("@defer/client") ||
!(pkg.dependencies || {}).includes("@defer/client") ||
!fs.existsSync(SRC_DEFER_CLIENT_PATH_FILE)
) {
throw new Error(
Expand Down

0 comments on commit 75399bc

Please sign in to comment.