firefox-profile
Advanced tools
Comparing version 0.3.13 to 0.4.0
@@ -0,1 +1,6 @@ | ||
# 0.4.0 | ||
* remove [`wrench`](https://github.com/ryanmcgrath/wrench-js) dependency (no longer maintained), replaced by [`fs-extra`](https://github.com/jprichardson/node-fs-extra) | ||
* updated package versions | ||
# 0.3.13 | ||
@@ -2,0 +7,0 @@ |
@@ -11,3 +11,2 @@ /** | ||
parseString = require('xml2js').parseString, | ||
wrench = require('wrench'), | ||
AdmZip = require('adm-zip'), | ||
@@ -94,2 +93,6 @@ archiver = require('archiver'), | ||
function isNotLockFile(filePath) { | ||
var file = path.basename(filePath); | ||
return !/^(parent\.lock|lock|\.parentlock)$/.test(file); | ||
} | ||
/** | ||
@@ -102,10 +105,10 @@ * Initialize a new instance of a Firefox Profile. | ||
* | ||
* @param {Object|String|null} options optional. | ||
* @param {Object|String|null} options optional. | ||
* | ||
* | ||
* If it is an object, it can contain the following option: | ||
* If it is an object, it can contain the following option: | ||
* * profileDirectory: the profile to copy. Not recommended: use FirefoxProfile.copy instead | ||
* * destinationDirectory: where the profile will be stored. If not provided, | ||
* * destinationDirectory: where the profile will be stored. If not provided, | ||
* a tmp directory will be used WARNING: if the tmp directory will be deleted when the process will terminate. | ||
* | ||
* | ||
* if it is a string it will copy the directory synchronously | ||
@@ -129,6 +132,5 @@ * (not recommended at all, kept for backward compatibility). | ||
var tmpDir = opts.destinationDirectory || this._createTempFolder('-copy'); | ||
wrench.copyDirSyncRecursive(opts.profileDirectory, tmpDir, { | ||
forceDelete: true, | ||
preserveFiles: hasDestDir, | ||
filter: /^(parent\.lock|lock|\.parentlock)$/ // excludes parent.lock, lock, .parentlock | ||
fs.copySync(opts.profileDirectory, tmpDir, { | ||
clobber: true, | ||
filter: isNotLockFile | ||
}); | ||
@@ -163,12 +165,6 @@ this.profileDir = tmpDir; | ||
var self = this; | ||
wrench.copyDirRecursive(profileDirectory, this.profileDir, { | ||
forceDelete: true, | ||
preserveFiles: true | ||
// filter: /^(parent\.lock|lock|\.parentlock)$/ // does not work, not implemented in wrench (async version) | ||
}, function() { | ||
// remove parent.lock, lock or .parentlock files if they have been copied | ||
deleteParallel(['parent.lock', 'lock', '.parentlock'].map(function(file) { | ||
return path.join(self.profileDir, file); | ||
}), cb); | ||
}); | ||
fs.copy(profileDirectory, this.profileDir, { | ||
clobber: true, | ||
filter: isNotLockFile | ||
}, cb); | ||
}; | ||
@@ -181,5 +177,5 @@ | ||
* | ||
* if it is an object, the following properties are available: | ||
* if it is an object, the following properties are available: | ||
* * profileDirectory - required - the profile to copy. | ||
* * destinationDirectory: where the profile will be stored. If not provided, | ||
* * destinationDirectory: where the profile will be stored. If not provided, | ||
* a tmp directory will be used. WARNING: if the tmp directory will be deleted when the process exits. | ||
@@ -243,3 +239,3 @@ */ | ||
} | ||
wrench.rmdirRecursive(self.profileDir, false, function() { | ||
fs.remove(self.profileDir, function() { | ||
cb && cb(); | ||
@@ -262,3 +258,3 @@ }); | ||
try { | ||
wrench.rmdirSyncRecursive(this.profileDir, false); | ||
fs.removeSync(this.profileDir); | ||
} catch (e) { | ||
@@ -585,5 +581,4 @@ console.warn('[firefox-profile] cannot delete profileDir on exit', this.profileDir, e); | ||
fs.mkdir(addonPath, function() { | ||
wrench.copyDirRecursive(addon, addonPath, { | ||
forceDelete: true, | ||
preserveFiles: true, | ||
fs.copy(addon, addonPath, { | ||
clobber: true | ||
}, function() { | ||
@@ -599,3 +594,3 @@ next(); | ||
if (tmpDir) { | ||
wrench.rmdirRecursive(tmpDir, function() { | ||
fs.remove(tmpDir, function() { | ||
next(); | ||
@@ -602,0 +597,0 @@ }); |
{ | ||
"name": "firefox-profile", | ||
"version": "0.3.13", | ||
"version": "0.4.0", | ||
"description": "firefox profile for selenium WebDriverJs, admc/wd or any other node selenium driver that supports capabilities", | ||
@@ -78,12 +78,11 @@ "main": "lib/firefox_profile", | ||
"async": "~1.5.2", | ||
"fs-extra": "~0.28.0", | ||
"fs-extra": "~0.30.0", | ||
"ini": "~1.3.3", | ||
"jetpack-id": "1.0.0", | ||
"lazystream": "~1.0.0", | ||
"lodash": "~4.11.1", | ||
"lodash": "~4.12.0", | ||
"minimist": "^1.1.1", | ||
"node-uuid": "~1.4.7", | ||
"wrench": "~1.5.8", | ||
"xml2js": "~0.4.4" | ||
} | ||
} |
@@ -154,3 +154,3 @@ # firefox-profile-js | ||
## Coverage | ||
grunt mochacov:coverage | ||
@@ -165,3 +165,3 @@ | ||
* ~~fix bugs~~ | ||
* write more tests | ||
* ~~write more tests~~ | ||
* fix more bugs | ||
@@ -168,0 +168,0 @@ * ~~clean tmp directory on process 'exit' and 'SIGINT'~~ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11
41060
871
+ Addedfs-extra@0.30.0(transitive)
+ Addedlodash@4.12.0(transitive)
- Removedwrench@~1.5.8
- Removedfs-extra@0.28.0(transitive)
- Removedlodash@4.11.2(transitive)
- Removedwrench@1.5.9(transitive)
Updatedfs-extra@~0.30.0
Updatedlodash@~4.12.0