-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f18813b
commit 517b7ff
Showing
51 changed files
with
71 additions
and
4,179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env node | ||
const fs = require("fs-extra"); | ||
const git = require("nodegit"); | ||
const execSync = require('child_process').execSync; | ||
const versions = require("./versions"); | ||
|
||
// From https://gist.github.com/joerx/3296d972735adc5b4ec1 | ||
function clearRequireCache() { | ||
Object.keys(require.cache).forEach(function (key) { | ||
delete require.cache[key]; | ||
}); | ||
} | ||
|
||
const sidebars = []; | ||
|
||
(async function () { | ||
console.log("Cleanup versioned docs"); | ||
await fs.emptyDir("./versioned_docs"); | ||
await fs.emptyDir("./versioned_sidebars"); | ||
|
||
for (let version of versions) { | ||
const tempDir = fs.mkdtempSync('detox'); | ||
console.log("Clone repository into tmp directory"); | ||
const repo = await git.Clone("https://github.com/wix/detox.git", tempDir); | ||
|
||
console.log("Checking out version", version); | ||
await repo.checkoutBranch(version); | ||
|
||
console.log("Generating versioned doc for", version) | ||
execSync(`npm install && npm run version ${version}`, { cwd: tempDir + '/website' }) | ||
|
||
console.log("Copy versioned doc"); | ||
fs.copySync(`${tempDir}/website/versioned_docs/version-${version}`, `./versioned_docs/version-${version}`); | ||
|
||
console.log("Copy sidebar into versioned_sidebars"); | ||
clearRequireCache(); | ||
sidebars[version] = require(`./${tempDir}/website/sidebars`); | ||
|
||
sidebars[version][`version-${version}-docs`] = sidebars[version].docs; | ||
delete sidebars[version].docs; | ||
|
||
fs.writeFileSync(`./versioned_sidebars/version-${version}-sidebars.json`, JSON.stringify(sidebars[version]), "utf8"); | ||
|
||
console.log("Cleanup temporary clone"); | ||
await fs.remove(tempDir); | ||
} | ||
})(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
110 changes: 0 additions & 110 deletions
110
website/versioned_docs/version-6.X/APIRef.ActionsOnElement.md
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.