@@ -220,7 +220,14 @@ private void info(Console console) {
220
220
}
221
221
console .println (groupLabel );
222
222
parameters .forEach (parameter -> {
223
- console .println (" " + parameter .getName () + ": " + config .get (parameter .getName ()));
223
+ console .print (" " + parameter .getName () + ": " );
224
+ String value = config .get (parameter .getName ());
225
+ if (value .contains ("\n " )) {
226
+ console .println (" (multiline)" );
227
+ console .println (" " + value .replace ("\n " , "\n " ));
228
+ } else {
229
+ console .println (value );
230
+ }
224
231
});
225
232
console .println ("" );
226
233
});
@@ -303,7 +310,20 @@ private void startConsole(Console console, Session session, String[] args) {
303
310
}
304
311
305
312
synchronized private void bundler (Console console , String [] args ) {
313
+ final String gemfilePath = jRubyScriptEngineFactory .getConfiguration ().getGemfilePath ();
314
+ if (gemfilePath == null ) {
315
+ console .println (
316
+ "No Gemfile configured. Please set the 'bundle_gemfile_path' or 'bundle_gemfile_content' property in the add-on configuration." );
317
+ return ;
318
+ }
319
+
320
+ // we have to split this because we dont want to format the string with ruby '%w' in it
306
321
final String BUNDLER = """
322
+ require 'jruby'
323
+ JRuby.runtime.instance_config.update_native_env_enabled = false
324
+ ENV['BUNDLE_GEMFILE'] = '%s'
325
+ """ .formatted (gemfilePath ) + """
326
+
307
327
require "bundler"
308
328
require "bundler/friendly_errors"
309
329
@@ -319,20 +339,11 @@ synchronized private void bundler(Console console, String[] args) {
319
339
end
320
340
""" ;
321
341
322
- String originalDir = System .setProperty ("user.dir" , scriptFileWatcher .getWatchPath ().toString ());
323
- try {
324
- executeWithPlainJRuby (console , engine -> {
325
- engine .put (ScriptEngine .ARGV , args );
326
- engine .eval (BUNDLER );
327
- return null ;
328
- });
329
- } finally {
330
- if (originalDir == null ) {
331
- System .clearProperty ("user.dir" );
332
- } else {
333
- System .setProperty ("user.dir" , originalDir );
334
- }
335
- }
342
+ executeWithPlainJRuby (console , engine -> {
343
+ engine .put (ScriptEngine .ARGV , args );
344
+ engine .eval (BUNDLER );
345
+ return null ;
346
+ });
336
347
}
337
348
338
349
synchronized private void gem (Console console , String [] args ) {
0 commit comments