* The `clone` method duplicates a cache. Some package managers can * leverage a pre-existing state to speed up their installation. * * @method destroy * @param {String} fromLabel The label for the cache to clone. * @param {String} toLabel The label for the new cache.
(fromLabel, toLabel)
| 648 | * @param {String} toLabel The label for the new cache. |
| 649 | */ |
| 650 | clone(fromLabel, toLabel) { |
| 651 | process.chdir(this.rootPath); |
| 652 | let outputDir = quickTemp.makeOrReuse(this.dirs, toLabel); |
| 653 | process.chdir(originalWorkingDirectory); |
| 654 | |
| 655 | this._conf.set(toLabel, outputDir); |
| 656 | |
| 657 | fs.copySync(this.get(fromLabel), outputDir); |
| 658 | |
| 659 | return this.dirs[toLabel]; |
| 660 | } |
| 661 | }; |
no test coverage detected