mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 11:17:04 +08:00
implemented for ios as well
This commit is contained in:
@ -2099,6 +2099,7 @@
|
|||||||
<Content Include="apps\custom-root-view\package.json">
|
<Content Include="apps\custom-root-view\package.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="apps\tests\file-system-access-tests\folder\file.expected" />
|
||||||
<None Include="js-libs\esprima\LICENSE.BSD" />
|
<None Include="js-libs\esprima\LICENSE.BSD" />
|
||||||
<Content Include="source-control.md" />
|
<Content Include="source-control.md" />
|
||||||
<Content Include="ui\segmented-bar\package.json">
|
<Content Include="ui\segmented-bar\package.json">
|
||||||
@ -2196,7 +2197,7 @@
|
|||||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||||
</WebProjectProperties>
|
</WebProjectProperties>
|
||||||
</FlavorProperties>
|
</FlavorProperties>
|
||||||
<UserProperties ui_2layouts_2wrap-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2grid-layout_2package_1json__JSONSchema="" ui_2layouts_2dock-layout_2package_1json__JSONSchema="" ui_2layouts_2absolute-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2web-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2content-view_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2gallery-app_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2absolute-layout-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2editable-text-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2scroll-view_2package_1json__JSONSchema="http://json.schemastore.org/package" />
|
<UserProperties ui_2scroll-view_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2editable-text-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2absolute-layout-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2gallery-app_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2content-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2web-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2absolute-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2dock-layout_2package_1json__JSONSchema="" ui_2layouts_2grid-layout_2package_1json__JSONSchema="" ui_2layouts_2wrap-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
</Project>
|
</Project>
|
@ -22,4 +22,15 @@ export var test_UTF8_BOM_is_not_returned = function () {
|
|||||||
TKUnit.assert(actualCharCode === expectedCharCode, "Actual character code: " + actualCharCode + "; Expected character code: " + expectedCharCode);
|
TKUnit.assert(actualCharCode === expectedCharCode, "Actual character code: " + actualCharCode + "; Expected character code: " + expectedCharCode);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export var test_file_exists_on_folder = function () {
|
||||||
|
var path = fs.path.join(__dirname, "folder");
|
||||||
|
|
||||||
|
if (!fs.Folder.exists(path)) {
|
||||||
|
TKUnit.assert(false, `Could not read path ${path}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TKUnit.assertFalse(fs.File.exists(path), "File.exists() returned true for folder!");
|
||||||
|
};
|
||||||
|
|
1
apps/tests/file-system-access-tests/folder/file.expected
Normal file
1
apps/tests/file-system-access-tests/folder/file.expected
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
@ -148,7 +148,7 @@ export class FileSystemAccess {
|
|||||||
|
|
||||||
public fileExists(path: string): boolean {
|
public fileExists(path: string): boolean {
|
||||||
var fileManager = NSFileManager.defaultManager();
|
var fileManager = NSFileManager.defaultManager();
|
||||||
return fileManager.fileExistsAtPath(path);
|
return fileManager.fileExistsAtPath(path) && !this.folderExists(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public folderExists(path: string): boolean {
|
public folderExists(path: string): boolean {
|
||||||
|
Reference in New Issue
Block a user