Skip to content

Commit 9c5c489

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
Still validating library path
1 parent 59859ea commit 9c5c489

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

lib/commands/add-library.ts

+13-5
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,20 @@ export class AddLibraryCommand implements ICommand {
2626
if (args.length !== 2) {
2727
this.$errors.fail("This command needs two parameters.");
2828
}
29-
29+
30+
let platform = args[0];
31+
let platformLowerCase = platform.toLowerCase();
3032
let libraryPath = path.resolve(args[1]);
31-
if(!this.$fs.exists(path.join(libraryPath, "project.properties")).wait()) {
32-
let files = this.$fs.enumerateFilesInDirectorySync(libraryPath);
33-
if(!_.any(files, file => path.extname(file) === ".jar")) {
34-
this.$errors.failWithoutHelp("Invalid library path. Ensure that the library path is the file path to a directory containing one or more `*.jar` files or to a directory containing the `project.properties` files.");
33+
if(platformLowerCase === "android") {
34+
if(!this.$fs.exists(path.join(libraryPath, "project.properties")).wait()) {
35+
let files = this.$fs.enumerateFilesInDirectorySync(libraryPath);
36+
if(!_.any(files, file => path.extname(file) === ".jar")) {
37+
this.$errors.failWithoutHelp("Invalid library path. Ensure that the library path is the file path to a directory containing one or more `*.jar` files or to a directory containing the `project.properties` files.");
38+
}
39+
}
40+
} else if(platformLowerCase === "ios") {
41+
if(path.extname(libraryPath) !== ".framework") {
42+
this.$errors.failWithoutHelp("Invalid library path. Ensure that the library path is a Cocoa Touch Framework with all build architectures enabled.");
3543
}
3644
}
3745

0 commit comments

Comments
 (0)