|
1 | 1 | import { copy } from '@ionic/utils-fs';
|
2 | 2 | import Debug from 'debug';
|
3 | 3 | import path from 'path';
|
| 4 | +import util from 'util'; |
4 | 5 |
|
5 |
| -import { Platform } from './platform'; |
| 6 | +import { Platform, prettyPlatform } from './platform'; |
6 | 7 |
|
7 | 8 | export interface NativeProjectConfig {
|
8 | 9 | directory: string;
|
@@ -184,15 +185,15 @@ export async function copyToNativeProject(platform: Platform, nativeProject: Nat
|
184 | 185 | const iosProjectDirectory = nativeProject.directory || 'ios';
|
185 | 186 | await copyImages(SOURCE_IOS_ICON, path.join(iosProjectDirectory, TARGET_IOS_ICON), IOS_ICONS);
|
186 | 187 | await copyImages(SOURCE_IOS_SPLASH, path.join(iosProjectDirectory, TARGET_IOS_SPLASH), IOS_SPLASHES);
|
187 |
| - logstream.write(`Copied ${IOS_ICONS.length + IOS_SPLASHES.length} resource items to ${platform}\n`); |
| 188 | + logstream.write(util.format(`Copied %s resource items to %s`, IOS_ICONS.length + IOS_SPLASHES.length, prettyPlatform(platform)) + '\n'); |
188 | 189 | } else if (platform === Platform.ANDROID) {
|
189 | 190 | const androidProjectDirectory = nativeProject.directory || 'android';
|
190 | 191 | await copyImages(SOURCE_ANDROID_ICON, path.join(androidProjectDirectory, TARGET_ANDROID_ICON), ANDROID_ICONS);
|
191 | 192 | await copyImages(SOURCE_ANDROID_SPLASH, path.join(androidProjectDirectory, TARGET_ANDROID_SPLASH), ANDROID_SPLASHES);
|
192 |
| - logstream.write(`Copied ${ANDROID_ICONS.length + ANDROID_SPLASHES.length} resource items to ${platform}\n`); |
| 193 | + logstream.write(util.format(`Copied %s resource items to %s`, ANDROID_ICONS.length + ANDROID_SPLASHES.length, prettyPlatform(platform)) + '\n'); |
193 | 194 | } else {
|
194 | 195 | if (errstream) {
|
195 |
| - errstream.write(`WARN: Copying to native projects is not supported for ${platform}\n`); |
| 196 | + errstream.write(util.format('WARN: Copying to native projects is not supported for %s', prettyPlatform(platform)) + '\n'); |
196 | 197 | }
|
197 | 198 | }
|
198 | 199 | }
|
0 commit comments