core/src/main/java/io/fabric8/jube/util/InstallHelper.java
public static void chmodAllScripts(File installDir) {
        if (installDir == null) {
            System.out.println("WARN: installDir is null!");
            return;
        }

        // make scripts executable for current dir
        chmodScripts(installDir, DEFAULT_MATCHER);
        // and all files in the bin directory, as we assume they are all scripts
        // as some images like Apache Karaf has bin scripts with no file extension (eg bin/karaf) so we use all matcher
        chmodScripts(new File(installDir, "bin"), ALL_MATCHER);

        File executables = new File(installDir, "executables.properties");
        if (executables.exists()) {
            try {
                Properties properties = new Properties();
                try (InputStream stream = new FileInputStream(executables)) {
                    properties.load(stream);
                }
                for (String dir : properties.stringPropertyNames()) {
                    String property = properties.getProperty(dir);
                    Matcher matcher = new RegexpMatcher(property);
                    LOG.info(String.format("CHMOD %s with pattern %s", dir, property));
                    chmodScripts(new File(installDir, dir), matcher);
                }
            } catch (IOException e) {
                throw new IllegalStateException(e);
            }
        }
    }
/**
     * chmods the various scripts in the installation
     */
chmods the various scripts in the installation
chmods the various scripts in the installation
public static void chmodAllScripts(File installDir) {
        if (installDir == null) {
            System.out.println("WARN: installDir is null!");
            return;
        }
        chmodScripts(installDir, DEFAULT_MATCHER);
        chmodScripts(new File(installDir, "bin"), ALL_MATCHER);
        File executables = new File(installDir, "executables.properties");
        if (executables.exists()) {
            try {
                Properties properties = new Properties();
                try (InputStream stream = new FileInputStream(executables)) {
                    properties.load(stream);
                }
                for (String dir : properties.stringPropertyNames()) {
                    String property = properties.getProperty(dir);
                    Matcher matcher = new RegexpMatcher(property);
                    LOG.info(String.format("CHMOD %s with pattern %s", dir, property));
                    chmodScripts(new File(installDir, dir), matcher);
                }
            } catch (IOException e) {
                throw new IllegalStateException(e);
            }
        }
    }
public static void chmodAllScripts ( File installDir ) { if ( installDir == null ) { System . out . println ( "WARN: installDir is null!" ) ; return ; } chmodScripts ( installDir , DEFAULT_MATCHER ) ; chmodScripts ( new File ( installDir , "bin" ) , ALL_MATCHER ) ; File executables = new File ( installDir , "executables.properties" ) ; if ( executables . exists ( ) ) { try { Properties properties = new Properties ( ) ; try ( InputStream stream = new FileInputStream ( executables ) ) { properties . load ( stream ) ; } for ( String dir : properties . stringPropertyNames ( ) ) { String property = properties . getProperty ( dir ) ; Matcher matcher = new RegexpMatcher ( property ) ; LOG . info ( String . format ( "CHMOD %s with pattern %s" , dir , property ) ) ; chmodScripts ( new File ( installDir , dir ) , matcher ) ; } } catch ( IOException e ) { throw new IllegalStateException ( e ) ; } } }
chmods the various scripts in the installation
chmods the various scripts in the installation
// make scripts executable for current dir // and all files in the bin directory, as we assume they are all scripts // as some images like Apache Karaf has bin scripts with no file extension (eg bin/karaf) so we use all matcher