Skip to content

Commit 9d53195

Browse files
authored
fix: Fix emulator command arg data-dir (#1695)
The current gcloudRunner doesn't take any `--data-dir` flag due to a bug. This PR is to fix the `--data-dir` flag.
1 parent 732ae66 commit 9d53195

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ private LocalDatastoreHelper(Builder builder) {
163163
if (!builder.storeOnDisk) {
164164
gcloudCommand.add("--no-store-on-disk");
165165
}
166+
if (builder.dataDir != null) {
167+
gcloudCommand.add("--data-dir=" + getGcdPath());
168+
}
166169
GcloudEmulatorRunner gcloudRunner =
167170
new GcloudEmulatorRunner(gcloudCommand, VERSION_PREFIX, MIN_VERSION);
168171
List<String> binCommand = new ArrayList<>(Arrays.asList(binName, "start"));
169172
binCommand.add("--testing");
170173
binCommand.add(BIN_CMD_PORT_FLAG + getPort());
171174
binCommand.add(CONSISTENCY_FLAG + getConsistency());
172-
if (builder.dataDir != null) {
173-
gcloudCommand.add("--data-dir=" + getGcdPath());
174-
}
175175
DownloadableEmulatorRunner downloadRunner =
176176
new DownloadableEmulatorRunner(binCommand, EMULATOR_URL, MD5_CHECKSUM, ACCESS_TOKEN);
177177
this.emulatorRunners = ImmutableList.of(gcloudRunner, downloadRunner);

0 commit comments

Comments
 (0)