fix: do not create files for empty body of queries in the git repo (#21774)
We're currently creating an empty txt file even when there is no body for an API call. For eg, in GET API calls. We should check whether there is content in a file before creating the file. Fixes #21683
This commit is contained in:
parent
f1e6ad6849
commit
bfeab838f2
|
|
@ -414,7 +414,7 @@ public class FileUtilsImpl implements FileInterface {
|
|||
Files.createDirectories(path);
|
||||
// Write the user written query to .txt file to make conflict handling easier
|
||||
// Body will be null if the action is of type JS
|
||||
if (body != null) {
|
||||
if (StringUtils.hasLength(body)) {
|
||||
Path bodyPath = path.resolve(resourceName + CommonConstants.TEXT_FILE_EXTENSION);
|
||||
writeStringToFile(body, bodyPath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -494,8 +494,9 @@ public class GitExecutorImpl implements GitExecutor {
|
|||
for (String x : modifiedAssets) {
|
||||
if (x.contains(CommonConstants.CANVAS)) {
|
||||
modifiedPages++;
|
||||
} else if (x.contains(GitDirectories.ACTION_DIRECTORY + "/") && !x.endsWith(".json")) {
|
||||
String queryName = x.substring(x.lastIndexOf("/") + 1);
|
||||
} else if (x.contains(GitDirectories.ACTION_DIRECTORY + "/")) {
|
||||
String queryName = x.split(GitDirectories.ACTION_DIRECTORY + "/")[1];
|
||||
queryName = queryName.substring(0, queryName.indexOf("/"));
|
||||
String pageName = x.split("/")[1];
|
||||
if (!queriesModified.contains(pageName + queryName)) {
|
||||
queriesModified.add(pageName + queryName);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user