Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only add existing files to the ruby requires

This is a guard to not add to the list files that don't exist.
When sm is installed for the root user, those files are

    /opt/sm/core/sm/shell/ruby/core/functions.rb
    /opt/sm/core/sm/shell/ruby/core/initialize.rb

They look like core sm files: this fix is not the definitive one.
Are these files located elsewhere?
Should this block of code be entirely removed?
  • Loading branch information...
commit 0d308eccbf9181d9fdea6c11f61adc68ac37d825 1 parent 7245170
hmalphettes authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 core/internal/shell/extensions/execution/functions
View
5 core/internal/shell/extensions/execution/functions
@@ -191,7 +191,10 @@ __sm.extension.run()
requires=()
for script in functions initialize
do
- requires+=( "-r${__sm_modules_path}/ruby/core/${script}.rb" )
+ if [[ -f "${__sm_modules_path}/ruby/core/${script}.rb" ]]
+ then
+ requires+=( "-r${__sm_modules_path}/ruby/core/${script}.rb" )
+ fi
done
exec "${binary:-ruby}" -I"${__sm_modules_path}/ruby" -I"${extension_modules_path}/ruby" \
Please sign in to comment.
Something went wrong with that request. Please try again.