We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b370a26 commit 53de944Copy full SHA for 53de944
packages/cli/src/commands/addPlatform/addPlatform.ts
@@ -24,6 +24,7 @@ import {
24
} from '../init/template';
25
import {tmpdir} from 'os';
26
import {mkdtempSync} from 'graceful-fs';
27
+import {existsSync} from 'fs';
28
29
type Options = {
30
packageName: string;
@@ -175,6 +176,15 @@ async function addPlatform(
175
176
}
177
178
for (const platform of templateConfig.platforms) {
179
+ if (existsSync(join(root, platform))) {
180
+ throw new CLIError(
181
+ `Platform ${platform} already exists in the project. Directory ${join(
182
+ root,
183
+ platform,
184
+ )} is not empty.`,
185
+ );
186
+ }
187
+
188
await copyTemplate(
189
templateName,
190
templateConfig.templateDir,
0 commit comments