private SupportingFile getCommandSupportFile(String commands, String script, CommandType commandType)
            throws HyscaleException {

        FileSpec fileSpec = new FileSpec();

        SupportingFile supportingFile = new SupportingFile();

        if (StringUtils.isNotBlank(script) && StringUtils.isNotBlank(commands)) {
            // Command and script both found ignoring script file
            WorkflowLogger.persist(DockerfileActivity.COMMANDS_AND_SCRIPT_FOUND, commandType.toString());
        }
        if (StringUtils.isNotBlank(commands)) {
            fileSpec.setContent(getScript(commandType, commands));
            fileSpec.setName(getFileName(commandType));
        } else if (StringUtils.isNotBlank(script)) {
            File scriptFile = new File(SetupConfig.getAbsolutePath(script));
            if (!scriptFile.exists() || !scriptFile.isFile()) {
                throw new HyscaleException(DockerfileErrorCodes.SCRIPT_FILE_NOT_FOUND, script);
            }
            supportingFile.setFile(scriptFile);
            return supportingFile;
        }
        if (StringUtils.isBlank(fileSpec.getContent())) {
            return null;
        }
        supportingFile.setFileSpec(fileSpec);

        return supportingFile;
    }
If Script provided copy it to the directory Config Script, Run Script, Init
Script In case of commands write it to script file
dockerfile-generator/dockerfile-gen-services/src/main/java/io/hyscale/dockerfile/gen/services/manager/impl/DockerScriptManagerImpl.java