Skip to content

cache_samples.sh should create cache directory if does not exist #1553

@michael-valdron

Description

@michael-valdron

/kind bug

Which area is this bug related to?

/area registry

Bug Summary

Describe the bug:

The cache_samples.sh helper script fails if the given cache directory path does not exist.

To Reproduce:

Under cloned registry-support, run bash build-tools/cache_samples.sh <path_to_extraDevfileEntries.yaml> <non_existent_caching_path>

Expected behavior

The cache_samples.sh helper script should allow the creation of the cache directory if it does not exist.

Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable

mkdir: cannot create directory ‘samples/.cache/nodejs-basic’: No such file or directory

Additional context

Blocking #1142

Any workaround?

Create the cache directory before running this script. This expects the creation of the cache directory to be handled by all consumers of this helper script.

Suggestion on how to fix the bug

Change mkdir $samplesDir/$sample to mkdir -p $samplesDir/$sample: https://github.com/devfile/registry-support/blob/f77b0bf0fc614951a199fb049db07832d833f4da/build-tools/cache_samples.sh#L106

Metadata

Metadata

Labels

area/registryDevfile registry for stacks and infrastructurekind/bugSomething isn't working

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions