@@ -92,7 +92,7 @@ public Optional<File> getOptionalExecutable(boolean shouldEnsureInstallation) {
92
92
}
93
93
94
94
public File getExecutable () {
95
- return getOptionalExecutable ().orElseThrow (() -> new IllegalStateException ("Unable to find and install jbang! " ));
95
+ return getOptionalExecutable ().orElseThrow (() -> new IllegalStateException ("Unable to find and install JBang " ));
96
96
}
97
97
98
98
public Path getWorkingDirectory () {
@@ -158,7 +158,7 @@ public boolean isInstallable() {
158
158
public boolean promptForInstallation () {
159
159
// We don't want to prompt users for input when running tests.
160
160
if (interactiveMode
161
- && Prompt .yesOrNo (true , "JBang is needed to list / run jbang plugins, would you like to install it now ?" )) {
161
+ && Prompt .yesOrNo (true , "JBang is needed to list/ run JBang plugins, would you like to install it now?" )) {
162
162
return true ;
163
163
}
164
164
return false ;
@@ -180,15 +180,15 @@ private boolean doEnsureJBangIsInstalledInternal() {
180
180
return true ;
181
181
}
182
182
if (!isInstallable ()) {
183
- output .warn ("JBang is not installable! " );
183
+ output .warn ("JBang is not installable" );
184
184
return false ;
185
185
}
186
186
if (promptForInstallation ()) {
187
187
try {
188
188
installJBang ();
189
189
return true ;
190
190
} catch (Exception e ) {
191
- output .warn ("Failed to install jbang! " );
191
+ output .warn ("Failed to install JBang " );
192
192
return false ;
193
193
}
194
194
} else {
@@ -203,7 +203,7 @@ private Path getInstallationDir() {
203
203
dir = dir .map (Path ::getParent );
204
204
}
205
205
return dir .map (d -> d .resolve (".jbang" ))
206
- .orElseThrow (() -> new IllegalStateException ("Failed to determinte .jbang directory! " ));
206
+ .orElseThrow (() -> new IllegalStateException ("Failed to determine .jbang directory" ));
207
207
}
208
208
209
209
private void installJBang () {
@@ -212,13 +212,13 @@ private void installJBang() {
212
212
Path downloadDir = Files .createTempDirectory ("jbang-download-" );
213
213
214
214
if (!downloadDir .toFile ().exists () && !downloadDir .toFile ().mkdirs ()) {
215
- throw new IOException ("Failed to create jbang download directory: " + downloadDir .toAbsolutePath ().toString ());
215
+ throw new IOException ("Failed to create JBang download directory: " + downloadDir .toAbsolutePath ().toString ());
216
216
}
217
217
218
218
Path downloadFile = downloadDir .resolve ("jbang.zip" );
219
219
Path installDir = getInstallationDir ();
220
220
if (!installDir .toFile ().exists () && !installDir .toFile ().mkdirs ()) {
221
- throw new IOException ("Failed to create jbang install directory: " + installDir .toAbsolutePath ().toString ());
221
+ throw new IOException ("Failed to create JBang install directory: " + installDir .toAbsolutePath ().toString ());
222
222
}
223
223
HttpClient client = HttpClient .newBuilder ().followRedirects (HttpClient .Redirect .ALWAYS ).build ();
224
224
HttpRequest request = HttpRequest .newBuilder ()
0 commit comments