Skip to content
This repository has been archived by the owner on Jan 2, 2022. It is now read-only.

Commit

Permalink
fix: fix options parameter for cache functions
Browse files Browse the repository at this point in the history
Signed-off-by: Jonah Snider <[email protected]>
  • Loading branch information
jonahsnider committed Apr 1, 2020
1 parent f54d11b commit 6695550
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {join as joinPaths} from 'path';

interface NetlifyUtils {
cache: {
restore(path: string, options: {digest: string[]}): Promise<any>;
save(path: string, options: {digest: string[]}): Promise<any>;
restore(path: string, options?: Partial<{move: boolean}>): Promise<any>;
save(path: string, options?: Partial<{digests: string[]; move: boolean; ttl: number}>): Promise<any>;
};
}

Expand Down Expand Up @@ -39,9 +39,9 @@ function generateAbsolutePaths(
const buildDirPathFromProject = options.inputs.build_dir_path ?? '.';

/** The absolute path to the build folder for Next.js. */
const absoluteBuildDirPath = joinPaths(options.netlifyConfig.build.base, buildDirPathFromProject, buildDirName, 'cache');
/** The absolute path to the build manifest Next.js uses. */
// I don't actually know if this build manifest has any relation to the cache folder
const absoluteBuildDirPath = joinPaths(options.netlifyConfig.build.base, buildDirPathFromProject, buildDirName, 'cache');
/** The absolute path to the build manifest Next.js uses. */
// I don't actually know if this build manifest has any relation to the cache folder
const manifestPath = joinPaths(absoluteBuildDirPath, '..', 'build-manifest.json');

return {
Expand Down Expand Up @@ -79,7 +79,7 @@ module.exports = {
const paths = generateAbsolutePaths({netlifyConfig, inputs});

const success = await utils.cache.save(paths.absolute.buildDir, {
digest: [paths.absolute.manifest]
digests: [paths.absolute.manifest]
});

if (success) {
Expand Down

0 comments on commit 6695550

Please sign in to comment.