Skip to content

Commit

Permalink
platform: remove previous build options if file is missing
Browse files Browse the repository at this point in the history
"touch" would create the file if not present, but not delete its
contents if a previous run left the file in the build dir.
  • Loading branch information
pillo79 committed Aug 25, 2023
1 parent b3342a7 commit 5a48caa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ recipe.hooks.prebuild.4.pattern.windows=cmd /c IF EXIST "{build.source.path}\boo

# Check if custom build options exist in the sketch folder
recipe.hooks.prebuild.5.pattern=bash -c "[ ! -f "{build.source.path}"/build_opt.h ] || cp -f "{build.source.path}"/build_opt.h "{build.path}"/build_opt.h"
recipe.hooks.prebuild.6.pattern=bash -c "[ -f "{build.path}"/build_opt.h ] || touch "{build.path}"/build_opt.h"
recipe.hooks.prebuild.6.pattern=bash -c "[ -f "{build.path}"/build_opt.h ] || : > "{build.path}"/build_opt.h"

recipe.hooks.prebuild.5.pattern.windows=cmd /c if exist "{build.source.path}\build_opt.h" COPY /y "{build.source.path}\build_opt.h" "{build.path}\build_opt.h"
recipe.hooks.prebuild.6.pattern.windows=cmd /c if not exist "{build.path}\build_opt.h" type nul > "{build.path}\build_opt.h"
Expand Down

0 comments on commit 5a48caa

Please sign in to comment.