From 384c3854c8433c7abef118e3019b9d09a677728d Mon Sep 17 00:00:00 2001 From: Abner Oliveira Date: Wed, 10 Feb 2016 11:53:37 -0300 Subject: [PATCH 1/5] added method extractAllToAsync --- .gitignore | 74 ++++++++++++++++++++-------------------- adm-zip/adm-zip-tests.ts | 3 ++ adm-zip/adm-zip.d.ts | 12 ++++++- 3 files changed, 51 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index 2a52c95e0..35dd5a667 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,37 @@ -*.dll -*.exe -*.cmd -*.pdb -*.suo -*.js -*.user -*.cache -*.cs -*.sln -*.csproj -*.txt -*.map -*.swp -.DS_Store -npm-debug.log - -_Resharper.DefinitelyTyped -bin -obj -Properties - -# VIM backup files -*~ - -# test folder -_infrastructure/tests/build - -.idea -*.iml -*.js.map -!*.js/ - -node_modules - -.sublimets -.settings/launch.json +*.dll +*.exe +*.cmd +*.pdb +*.suo +*.js +*.user +*.cache +*.cs +*.sln +*.csproj +*.txt +*.map +*.swp +.DS_Store +npm-debug.log + +_Resharper.DefinitelyTyped +bin +obj +Properties + +# VIM backup files +*~ + +# test folder +_infrastructure/tests/build + +.idea +*.iml +*.js.map +!*.js/ + +node_modules + +.sublimets +.settings/launch.json diff --git a/adm-zip/adm-zip-tests.ts b/adm-zip/adm-zip-tests.ts index 93f8f2f2d..92be31516 100644 --- a/adm-zip/adm-zip-tests.ts +++ b/adm-zip/adm-zip-tests.ts @@ -18,6 +18,9 @@ zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/hom // extracts everything zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true); +// extracts everything and calls callback -> async extracction +zip.extractAllToAsync(/*target path*/"/home/me/zipcontent/", /*overwrite*/true, (error: Error)=> {}); + // creating archives var zip = new AdmZip(); diff --git a/adm-zip/adm-zip.d.ts b/adm-zip/adm-zip.d.ts index 208c13b27..eb0b04506 100644 --- a/adm-zip/adm-zip.d.ts +++ b/adm-zip/adm-zip.d.ts @@ -1,6 +1,6 @@ // Type definitions for adm-zip v0.4.4 // Project: https://github.com/cthackers/adm-zip -// Definitions by: John Vilk +// Definitions by: John Vilk , Abner Oliveira // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -211,6 +211,16 @@ declare module "adm-zip" { * will be overwriten if this is true. Default is FALSE */ extractAllTo(targetPath: string, overwrite?: boolean): void; + + /** + * Extracts the entire archive to the given location + * @param targetPath Target location + * @param overwrite If the file already exists at the target path, the file + * will be overwriten if this is true. Default is FALSE + * @param callback The callback function will be called afeter extraction + */ + extractAllToAsync(targetPath: string, overwrite: boolean, callback: (error: Error) => void): void; + /** * Writes the newly created zip file to disk at the specified location or * if a zip was opened and no ``targetFileName`` is provided, it will From 6977035f0441a173a6c38d0c4b485d224d153849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81bner=20Oliveira?= Date: Wed, 10 Feb 2016 16:16:30 -0300 Subject: [PATCH 2/5] removed unnecessary new lines --- adm-zip/adm-zip-tests.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/adm-zip/adm-zip-tests.ts b/adm-zip/adm-zip-tests.ts index 92be31516..8637751bf 100644 --- a/adm-zip/adm-zip-tests.ts +++ b/adm-zip/adm-zip-tests.ts @@ -17,11 +17,9 @@ console.log(zip.readAsText("some_folder/my_file.txt")); zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder", /*overwrite*/true) // extracts everything zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true); - // extracts everything and calls callback -> async extracction zip.extractAllToAsync(/*target path*/"/home/me/zipcontent/", /*overwrite*/true, (error: Error)=> {}); - // creating archives var zip = new AdmZip(); @@ -61,4 +59,4 @@ zip.extractEntryTo("folder/subfolder/myfile.txt", "/home/user/", false, true); function isAdmZipEntry(obj: any): obj is AdmZip.IZipEntry { return obj !== null && typeof obj === "object" && typeof obj['entryName'] === 'string'; -} \ No newline at end of file +} From ce839ad3f983843c16cfc928dcc6da8e8f954ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81bner=20Oliveira?= Date: Wed, 10 Feb 2016 16:21:36 -0300 Subject: [PATCH 3/5] removing extra line line --- adm-zip/adm-zip.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/adm-zip/adm-zip.d.ts b/adm-zip/adm-zip.d.ts index eb0b04506..fd107336c 100644 --- a/adm-zip/adm-zip.d.ts +++ b/adm-zip/adm-zip.d.ts @@ -211,7 +211,6 @@ declare module "adm-zip" { * will be overwriten if this is true. Default is FALSE */ extractAllTo(targetPath: string, overwrite?: boolean): void; - /** * Extracts the entire archive to the given location * @param targetPath Target location From 2c1bcbdf7f011ee1c14c456f2ccea086571eb0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81bner=20Oliveira?= Date: Wed, 10 Feb 2016 19:37:50 +0000 Subject: [PATCH 4/5] reverting .gitignore --- .gitignore | 74 +++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 35dd5a667..2a52c95e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,37 @@ -*.dll -*.exe -*.cmd -*.pdb -*.suo -*.js -*.user -*.cache -*.cs -*.sln -*.csproj -*.txt -*.map -*.swp -.DS_Store -npm-debug.log - -_Resharper.DefinitelyTyped -bin -obj -Properties - -# VIM backup files -*~ - -# test folder -_infrastructure/tests/build - -.idea -*.iml -*.js.map -!*.js/ - -node_modules - -.sublimets -.settings/launch.json +*.dll +*.exe +*.cmd +*.pdb +*.suo +*.js +*.user +*.cache +*.cs +*.sln +*.csproj +*.txt +*.map +*.swp +.DS_Store +npm-debug.log + +_Resharper.DefinitelyTyped +bin +obj +Properties + +# VIM backup files +*~ + +# test folder +_infrastructure/tests/build + +.idea +*.iml +*.js.map +!*.js/ + +node_modules + +.sublimets +.settings/launch.json From b9b00e1578081207abf3e73db58c5c77331f7c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81bner=20Oliveira?= Date: Wed, 10 Feb 2016 23:35:17 -0300 Subject: [PATCH 5/5] removed white line --- adm-zip/adm-zip.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/adm-zip/adm-zip.d.ts b/adm-zip/adm-zip.d.ts index fd107336c..a42978ca8 100644 --- a/adm-zip/adm-zip.d.ts +++ b/adm-zip/adm-zip.d.ts @@ -219,7 +219,6 @@ declare module "adm-zip" { * @param callback The callback function will be called afeter extraction */ extractAllToAsync(targetPath: string, overwrite: boolean, callback: (error: Error) => void): void; - /** * Writes the newly created zip file to disk at the specified location or * if a zip was opened and no ``targetFileName`` is provided, it will