@@ -144,8 +144,9 @@ private void assertHasExpectedLayers(Buildpack buildpack) throws IOException {
144
144
}
145
145
146
146
private void writeBuildpackDescriptor () throws IOException {
147
- File descriptor = new File (this .buildpackDir , "buildpack.toml" );
148
- try (PrintWriter writer = new PrintWriter (Files .newBufferedWriter (descriptor .toPath ()))) {
147
+ Path descriptor = Files .createFile (Paths .get (this .buildpackDir .getAbsolutePath (), "buildpack.toml" ),
148
+ PosixFilePermissions .asFileAttribute (PosixFilePermissions .fromString ("rw-r--r--" )));
149
+ try (PrintWriter writer = new PrintWriter (Files .newBufferedWriter (descriptor ))) {
149
150
writer .println ("[buildpack]" );
150
151
writer .println ("id = \" example/buildpack1\" " );
151
152
writer .println ("version = \" 0.0.1\" " );
@@ -157,15 +158,16 @@ private void writeBuildpackDescriptor() throws IOException {
157
158
}
158
159
159
160
private void writeScripts () throws IOException {
160
- File binDirectory = new File (this .buildpackDir , "bin" );
161
- binDirectory .mkdirs ();
162
- Path detect = Files .createFile (Paths .get (binDirectory .getAbsolutePath (), "detect" ),
161
+ Path binDirectory = Files .createDirectory (Paths .get (this .buildpackDir .getAbsolutePath (), "bin" ),
162
+ PosixFilePermissions .asFileAttribute (PosixFilePermissions .fromString ("rwxr-xr-x" )));
163
+ binDirectory .toFile ().mkdirs ();
164
+ Path detect = Files .createFile (Paths .get (binDirectory .toString (), "detect" ),
163
165
PosixFilePermissions .asFileAttribute (PosixFilePermissions .fromString ("rwxr--r--" )));
164
166
try (PrintWriter writer = new PrintWriter (Files .newBufferedWriter (detect ))) {
165
167
writer .println ("#!/usr/bin/env bash" );
166
168
writer .println ("echo \" ---> detect\" " );
167
169
}
168
- Path build = Files .createFile (Paths .get (binDirectory .getAbsolutePath (), "build" ),
170
+ Path build = Files .createFile (Paths .get (binDirectory .toString (), "build" ),
169
171
PosixFilePermissions .asFileAttribute (PosixFilePermissions .fromString ("rwxr--r--" )));
170
172
try (PrintWriter writer = new PrintWriter (Files .newBufferedWriter (build ))) {
171
173
writer .println ("#!/usr/bin/env bash" );
0 commit comments