paths[i] = paths[i].replace('\\', '/');
boolean createNoJekyll = noJekyll;
for (String path : paths) {
TreeEntry entry = new TreeEntry();
entry.setPath(prefix + path);
// Only create a .nojekyll file if it doesn't already exist
if (createNoJekyll && NO_JEKYLL_FILE.equals(entry.getPath()))
createNoJekyll = false;
entry.setType(TYPE_BLOB);
entry.setMode(MODE_BLOB);
entry.setSha(createBlob(service, repository, outputDirectory, path));
entries.add(entry);
}
if (createNoJekyll) {
TreeEntry entry = new TreeEntry();
entry.setPath(NO_JEKYLL_FILE);
entry.setType(TYPE_BLOB);
entry.setMode(MODE_BLOB);
if (isDebug())
debug("Creating empty .nojekyll blob at root of tree");
if (!dryRun)
try {
entry.setSha(service.createBlob(repository, new Blob()
.setEncoding(ENCODING_BASE64).setContent("")));
} catch (IOException e) {
throw new MojoExecutionException(
"Error creating .nojekyll empty blob: "
+ getExceptionMessage(e), e);