mirror of
https://gitee.com/dcren/initializr.git
synced 2025-05-18 22:19:41 +08:00
Merge pull request #933 from htztomic
* pr/933: Ensure executable bit is set on wrapper when baseDir has space Closes gh-933
This commit is contained in:
commit
9df2d29462
@ -230,13 +230,13 @@ public class MainController extends AbstractInitializrController {
|
|||||||
ZipFileSet set = new ZipFileSet();
|
ZipFileSet set = new ZipFileSet();
|
||||||
set.setDir(dir);
|
set.setDir(dir);
|
||||||
set.setFileMode("755");
|
set.setFileMode("755");
|
||||||
set.setIncludes(wrapperScript);
|
set.createInclude().setName(wrapperScript);
|
||||||
set.setDefaultexcludes(false);
|
set.setDefaultexcludes(false);
|
||||||
zip.addFileset(set);
|
zip.addFileset(set);
|
||||||
set = new ZipFileSet();
|
set = new ZipFileSet();
|
||||||
set.setDir(dir);
|
set.setDir(dir);
|
||||||
set.setIncludes("**,");
|
set.setIncludes("**,");
|
||||||
set.setExcludes(wrapperScript);
|
set.createExclude().setName(wrapperScript);
|
||||||
set.setDefaultexcludes(false);
|
set.setDefaultexcludes(false);
|
||||||
zip.addFileset(set);
|
zip.addFileset(set);
|
||||||
zip.setDestFile(download.getCanonicalFile());
|
zip.setDestFile(download.getCanonicalFile());
|
||||||
@ -257,12 +257,12 @@ public class MainController extends AbstractInitializrController {
|
|||||||
TarFileSet set = zip.createTarFileSet();
|
TarFileSet set = zip.createTarFileSet();
|
||||||
set.setDir(dir);
|
set.setDir(dir);
|
||||||
set.setFileMode("755");
|
set.setFileMode("755");
|
||||||
set.setIncludes(wrapperScript);
|
set.createInclude().setName(wrapperScript);
|
||||||
set.setDefaultexcludes(false);
|
set.setDefaultexcludes(false);
|
||||||
set = zip.createTarFileSet();
|
set = zip.createTarFileSet();
|
||||||
set.setDir(dir);
|
set.setDir(dir);
|
||||||
set.setIncludes("**,");
|
set.setIncludes("**,");
|
||||||
set.setExcludes(wrapperScript);
|
set.createExclude().setName(wrapperScript);
|
||||||
set.setDefaultexcludes(false);
|
set.setDefaultexcludes(false);
|
||||||
zip.setDestFile(download.getCanonicalFile());
|
zip.setDestFile(download.getCanonicalFile());
|
||||||
Tar.TarCompressionMethod method = new Tar.TarCompressionMethod();
|
Tar.TarCompressionMethod method = new Tar.TarCompressionMethod();
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012-2019 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.spring.initializr.web.project;
|
||||||
|
|
||||||
|
import io.spring.initializr.web.AbstractFullStackInitializrIntegrationTests;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author HaiTao Zhang
|
||||||
|
*/
|
||||||
|
@ActiveProfiles("test-default")
|
||||||
|
public class MainControllerArchiveIntegrationTests extends AbstractFullStackInitializrIntegrationTests {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void baseDirectorySeparatedBySpace() {
|
||||||
|
ResponseEntity<byte[]> entity = downloadArchive("/starter.zip?artifactId=demo&baseDir=demo trial");
|
||||||
|
zipProjectAssert(entity.getBody()).hasBaseDir("demo trial").hasExecutableFile("mvnw").isJavaProject();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user