From e2f1da08074ea33e81ff1648689bb61dabc39972 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:01:25 -0400 Subject: [PATCH 01/15] awe here we go again with this bullshit --- bin/mvb.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/bin/mvb.js b/bin/mvb.js index 7cbe97c..a1366de 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -102,16 +102,17 @@ const options = { debug('multiversion build from %o using resolved build options: %O', srcDir, options); // determine gitdir -// @TODO: throw error if no git dir? -const gitDir = traverseUp(['.git'], osource).find(dir => fs.existsSync(dir)); +const gitDir = path.resolve(traverseUp(['.git'], osource).find(dir => fs.existsSync(dir))); debug('determined git-dir: %o', gitDir); // do the initial setup fs.removeSync(options.tmpDir, {force: true, maxRetries: 10, recursive: true}); fs.mkdirSync(options.tmpDir, {recursive: true}); -// create execers for source and tmp opts -const oexec = createExec({cwd: process.cwd(), debug}); +// copy the source repo to tmp +fs.copySync(osource, options.tmpDir); + +// create execer for tmp opts const exec = createExec({cwd: options.tmpDir, debug}); // start it up @@ -122,14 +123,18 @@ const updateArgs = ['fetch', 'origin', '--tags', '--no-filter']; // if shallow then add to update refs if (getStdOut('git rev-parse --is-shallow-repository', {trim: true}) === 'true') updateArgs.push('--unshallow'); // update all refs -await oexec('git', updateArgs); +await exec('git', updateArgs); -await oexec('git', ['status']); -console.log(getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true})); -await oexec('git', ['diff']); +await exec('git', ['status']); +await exec('git', ['--no-pager', 'tag']); +await exec('git', ['--no-pager', 'branch', '--all']); +await exec('cat', ['.git/config']); + +await exec('git', ['diff']); // if we are in detached head state then checkout best branch if (getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true}) === 'HEAD') await oexec('git', ['checkout', getBranch()]); +console.log(getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true})); process.exit(1) From 786ff3366b365bace67d843d95a086dae784c9e4 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:02:30 -0400 Subject: [PATCH 02/15] awe here we go again with this bullshit part 2 --- .github/workflows/pr-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index 1eb677d..158193c 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -38,5 +38,5 @@ jobs: - name: Test build run: npm run build - name: Test multiversion build - run: npx mvb docs --no-cache + run: npx mvb docs --no-cache --debug From 0f90f40b97c018d2b3574c11eb240581529b2c3f Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:03:23 -0400 Subject: [PATCH 03/15] awe here we go again with this bullshit part 3 --- bin/mvb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mvb.js b/bin/mvb.js index a1366de..4f4b685 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -136,7 +136,7 @@ await exec('git', ['diff']); if (getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true}) === 'HEAD') await oexec('git', ['checkout', getBranch()]); console.log(getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true})); -process.exit(1) +process.exit(1); // build clone args const cloneArgs = ['clone', '--origin', 'origin', '--no-single-branch']; From f150715fc0305f2215dd592e5db34c86509ce8d6 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:10:37 -0400 Subject: [PATCH 04/15] awe here we go again with this bullshit part 4 --- bin/mvb.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/mvb.js b/bin/mvb.js index 4f4b685..6d81add 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -1,5 +1,6 @@ #!/usr/bin/env node import crypto from 'node:crypto'; +import os from 'node:os'; import path from 'node:path'; import {format, inspect} from 'node:util'; @@ -97,12 +98,13 @@ const options = { ...defaults, ...argv, cacheDir: path.resolve(cacheBase, '@lando', 'mvb'), - tmpDir: path.resolve(siteConfig.tempDir, nanoid()), + tmpDir: path.resolve(os.tmpdir(), nanoid()), + // tmpDir: path.resolve(siteConfig.tempDir, nanoid()), }; debug('multiversion build from %o using resolved build options: %O', srcDir, options); // determine gitdir -const gitDir = path.resolve(traverseUp(['.git'], osource).find(dir => fs.existsSync(dir))); +const gitDir = path.resolve(traverseUp(['.git'], osource).find(dir => fs.existsSync(dir)), '..'); debug('determined git-dir: %o', gitDir); // do the initial setup @@ -110,7 +112,7 @@ fs.removeSync(options.tmpDir, {force: true, maxRetries: 10, recursive: true}); fs.mkdirSync(options.tmpDir, {recursive: true}); // copy the source repo to tmp -fs.copySync(osource, options.tmpDir); +fs.copySync(gitDir, options.tmpDir); // create execer for tmp opts const exec = createExec({cwd: options.tmpDir, debug}); From b52e43de3da9ca55f96b1f0f46b7747f30d52833 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:14:08 -0400 Subject: [PATCH 05/15] awe here we go again with this bullshit part 5 --- bin/mvb.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/bin/mvb.js b/bin/mvb.js index 6d81add..6a8cd75 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -135,20 +135,9 @@ await exec('cat', ['.git/config']); await exec('git', ['diff']); // if we are in detached head state then checkout best branch -if (getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true}) === 'HEAD') await oexec('git', ['checkout', getBranch()]); +// if (getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true}) === 'HEAD') await oexec('git', ['checkout', getBranch()]); console.log(getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true})); -process.exit(1); - -// build clone args -const cloneArgs = ['clone', '--origin', 'origin', '--no-single-branch']; -// netlicf clone -if (onNetlify) cloneArgs.push('--depth', '2147483647', '--branch', getBranch(), getCloneUrl(), './'); -// generic clone -else cloneArgs.push('--no-local', '--no-hardlinks', gitDir, './'); -// do the vampire -await exec('git', cloneArgs); - // get extended version information const {extended} = await getTags(options.tmpDir, options); debug('determined versions to build: %o', extended); From 24df9169e122fa01c5866ccfb9c4c100968118e8 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:17:34 -0400 Subject: [PATCH 06/15] awe here we go again with this bullshit part 6 --- bin/mvb.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/bin/mvb.js b/bin/mvb.js index 6a8cd75..9fd7e40 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -20,10 +20,6 @@ import Debug from 'debug'; // debugger const debug = Debug('@lando/mvb'); // eslint-disable-line -// helper to get remote git clone url -const getCloneUrl = () => getStdOut('git config --get remote.origin.url', {trim: true}); -// env -const onNetlify = process.env?.NETLIFY === 'true'; // enable debug if applicable if (process.argv.includes('--debug') || process.env.RUNNER_DEBUG === '1') { @@ -90,14 +86,11 @@ debug('received argv %o', argv); debug('default options %o', defaults); log('found site %s at %s', magenta(site.title), magenta(osource)); -// determine cachebase -const cacheBase = onNetlify ? '/opt/build/cache' : siteConfig.cacheDir; - // resolve options with argv input const options = { ...defaults, ...argv, - cacheDir: path.resolve(cacheBase, '@lando', 'mvb'), + cacheDir: path.resolve(process.env?.NETLIFY === 'true' ? '/opt/build/cache' : siteConfig.cacheDir, '@lando', 'mvb'), tmpDir: path.resolve(os.tmpdir(), nanoid()), // tmpDir: path.resolve(siteConfig.tempDir, nanoid()), }; From 6b3fefc4bdfcb1693106982dc711e12068241290 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:22:09 -0400 Subject: [PATCH 07/15] awe here we go again with this bullshit part 7 --- bin/mvb.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/mvb.js b/bin/mvb.js index 9fd7e40..ac24460 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -119,6 +119,8 @@ const updateArgs = ['fetch', 'origin', '--tags', '--no-filter']; if (getStdOut('git rev-parse --is-shallow-repository', {trim: true}) === 'true') updateArgs.push('--unshallow'); // update all refs await exec('git', updateArgs); +// checkout branch +await exec('git', ['checkout', getBranch()]); await exec('git', ['status']); await exec('git', ['--no-pager', 'tag']); From aa14fb0db300df0bea6c9fa3fa78c7231bd935e1 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:26:09 -0400 Subject: [PATCH 08/15] awe here we go again with this bullshit part 8 --- bin/mvb.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/mvb.js b/bin/mvb.js index ac24460..bed2372 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -113,14 +113,15 @@ const exec = createExec({cwd: options.tmpDir, debug}); // start it up log('collecting version information from %s...', magenta(gitDir)); -// lets make sure the source repo at least has all the tag information it needs +// checkout branch +await exec('git', ['checkout', getBranch()]); + +// lets make sure the source repo at least has all the tag and branch information it needs const updateArgs = ['fetch', 'origin', '--tags', '--no-filter']; // if shallow then add to update refs if (getStdOut('git rev-parse --is-shallow-repository', {trim: true}) === 'true') updateArgs.push('--unshallow'); // update all refs await exec('git', updateArgs); -// checkout branch -await exec('git', ['checkout', getBranch()]); await exec('git', ['status']); await exec('git', ['--no-pager', 'tag']); From 2f5ce75f9ab41c6c4a149b4979ac063513229679 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:31:48 -0400 Subject: [PATCH 09/15] awe here we go again with this bullshit part 9 --- bin/mvb.js | 7 +++---- utils/get-tags.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/mvb.js b/bin/mvb.js index bed2372..ac24460 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -113,15 +113,14 @@ const exec = createExec({cwd: options.tmpDir, debug}); // start it up log('collecting version information from %s...', magenta(gitDir)); -// checkout branch -await exec('git', ['checkout', getBranch()]); - -// lets make sure the source repo at least has all the tag and branch information it needs +// lets make sure the source repo at least has all the tag information it needs const updateArgs = ['fetch', 'origin', '--tags', '--no-filter']; // if shallow then add to update refs if (getStdOut('git rev-parse --is-shallow-repository', {trim: true}) === 'true') updateArgs.push('--unshallow'); // update all refs await exec('git', updateArgs); +// checkout branch +await exec('git', ['checkout', getBranch()]); await exec('git', ['status']); await exec('git', ['--no-pager', 'tag']); diff --git a/utils/get-tags.js b/utils/get-tags.js index 244cc2d..3cc2d82 100644 --- a/utils/get-tags.js +++ b/utils/get-tags.js @@ -38,7 +38,7 @@ export default function async( if (versions.length > 0) { aliases.edge = versions[0]; aliases.stable = versions.filter(version => semver.prerelease(version) === null)[0]; - aliases.dev = getStdOut(`git describe --tags --always --abbrev=1 --match="${match}" ${getBranch(cwd)}`, {trim: true}); + aliases.dev = getStdOut(`git describe --tags --always --abbrev=1 --match="${match}" ${getBranch(cwd)}`, opts); } debug('generated aliases %o', aliases); From f7543ec58e3c8dd9ce7c41df8cb502300f226cf0 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:39:57 -0400 Subject: [PATCH 10/15] awe here we go again with this bullshit part 10 --- bin/mvb.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/mvb.js b/bin/mvb.js index ac24460..e4d58ab 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -104,10 +104,8 @@ debug('determined git-dir: %o', gitDir); fs.removeSync(options.tmpDir, {force: true, maxRetries: 10, recursive: true}); fs.mkdirSync(options.tmpDir, {recursive: true}); -// copy the source repo to tmp -fs.copySync(gitDir, options.tmpDir); - -// create execer for tmp opts +// create execers for source and tmp opts +const oexec = createExec({cwd: process.cwd(), debug}); const exec = createExec({cwd: options.tmpDir, debug}); // start it up @@ -117,10 +115,13 @@ log('collecting version information from %s...', magenta(gitDir)); const updateArgs = ['fetch', 'origin', '--tags', '--no-filter']; // if shallow then add to update refs if (getStdOut('git rev-parse --is-shallow-repository', {trim: true}) === 'true') updateArgs.push('--unshallow'); -// update all refs -await exec('git', updateArgs); +// update original +await oexec('git', updateArgs); // checkout branch -await exec('git', ['checkout', getBranch()]); +await oexec('git', ['checkout', getBranch()]); + +// and then copy the repo in tmpdir so we can operate on it +fs.copySync(gitDir, options.tmpDir); await exec('git', ['status']); await exec('git', ['--no-pager', 'tag']); @@ -133,6 +134,8 @@ await exec('git', ['diff']); // if (getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true}) === 'HEAD') await oexec('git', ['checkout', getBranch()]); console.log(getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true})); +process.exit(1) + // get extended version information const {extended} = await getTags(options.tmpDir, options); debug('determined versions to build: %o', extended); From 9a6b8ae570905ea084d0ee157e7a5d20f6354755 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:40:50 -0400 Subject: [PATCH 11/15] awe here we go again with this bullshit part 11 --- bin/mvb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mvb.js b/bin/mvb.js index e4d58ab..a4e11cc 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -134,7 +134,7 @@ await exec('git', ['diff']); // if (getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true}) === 'HEAD') await oexec('git', ['checkout', getBranch()]); console.log(getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true})); -process.exit(1) +process.exit(1); // get extended version information const {extended} = await getTags(options.tmpDir, options); From 5168feee1ddce22906fe3c40350101cb032508a5 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 14:43:10 -0400 Subject: [PATCH 12/15] awe here we go again with this bullshit part 12 --- .github/workflows/pr-tests.yml | 2 +- bin/mvb.js | 13 ------------- netlify.toml | 2 +- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index 158193c..1eb677d 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -38,5 +38,5 @@ jobs: - name: Test build run: npm run build - name: Test multiversion build - run: npx mvb docs --no-cache --debug + run: npx mvb docs --no-cache diff --git a/bin/mvb.js b/bin/mvb.js index a4e11cc..40d1076 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -123,19 +123,6 @@ await oexec('git', ['checkout', getBranch()]); // and then copy the repo in tmpdir so we can operate on it fs.copySync(gitDir, options.tmpDir); -await exec('git', ['status']); -await exec('git', ['--no-pager', 'tag']); -await exec('git', ['--no-pager', 'branch', '--all']); -await exec('cat', ['.git/config']); - -await exec('git', ['diff']); - -// if we are in detached head state then checkout best branch -// if (getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true}) === 'HEAD') await oexec('git', ['checkout', getBranch()]); -console.log(getStdOut('git rev-parse --abbrev-ref HEAD', {trim: true})); - -process.exit(1); - // get extended version information const {extended} = await getTags(options.tmpDir, options); debug('determined versions to build: %o', extended); diff --git a/netlify.toml b/netlify.toml index fc3b7c9..12f77ad 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,7 +1,7 @@ [build] base = "./" publish = "docs/.vitepress/dist/" - command = "npx mvb docs --no-cache --debug" + command = "npx mvb docs --no-cache" # Sets our asset optimization [build.processing.css] From 0806283b82a8cc13d3f7d2794c4cdaa049f329d3 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 15:04:39 -0400 Subject: [PATCH 13/15] awe here we go again with this bullshit part 13 --- bin/mvb.js | 2 +- netlify.toml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/mvb.js b/bin/mvb.js index 40d1076..7cc1349 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -109,7 +109,7 @@ const oexec = createExec({cwd: process.cwd(), debug}); const exec = createExec({cwd: options.tmpDir, debug}); // start it up -log('collecting version information from %s...', magenta(gitDir)); +log('setting up mvb build environment using %s...', magenta(gitDir)); // lets make sure the source repo at least has all the tag information it needs const updateArgs = ['fetch', 'origin', '--tags', '--no-filter']; diff --git a/netlify.toml b/netlify.toml index 12f77ad..d669bd7 100644 --- a/netlify.toml +++ b/netlify.toml @@ -34,3 +34,13 @@ [plugins.inputs] skipPatterns = [ ".rss", ".gif", ".jpg", 'x.com', 'twitter.com', '/v/' ] checkExternal = true + +# mvb redirects +[[redirects]] + from = "/v/:version/v/" + to = "/v/" + status = 301 +[[redirects]] + from = "/v/:first/v/:second/" + to = "/v/:second/" + status = 301 From 98eddfa57d37cf7fae539725944b9e6d231e9d96 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 15:27:28 -0400 Subject: [PATCH 14/15] provide stealth rel=mvp attribute to help absolute path versioned doc sites --- components/VPLLink.vue | 22 ++++++++++++++-------- docs/.vitepress/config.js | 6 +++--- netlify.toml | 10 ---------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/components/VPLLink.vue b/components/VPLLink.vue index db4a6d3..472f20d 100644 --- a/components/VPLLink.vue +++ b/components/VPLLink.vue @@ -4,12 +4,13 @@ class="VPLink" :class="{ link: href, + 'lando': true, 'vp-external-link-icon': isExternal, 'no-icon': noIcon }" - :href="href ? normalizeLink(href) : undefined" + :href="link" :target="target ?? (isExternal ? '_blank' : isFauxInternal ? '_self' : undefined)" - :rel="rel ?? (isExternal ? 'noreferrer' : undefined)" + :rel="relation ?? (isExternal ? 'noreferrer' : undefined)" > @@ -26,6 +27,10 @@ const {theme} = useData(); const {internalDomains} = theme.value; const props = defineProps({ + absolute: { + type: Boolean, + default: false, + }, tag: { type: String, default: undefined, @@ -48,13 +53,14 @@ const props = defineProps({ }, }); +const relation = computed(() => props.rel === 'mvb' ? 'alternate' : props.rel); const tag = computed(() => props.tag ?? (props.href ? 'a' : 'span')); -const isFauxInternal = computed(() => { - return props.href && internalDomains.find(domain => props.href.startsWith(domain)) !== undefined; -}); - +const isFauxInternal = computed(() => props.href && internalDomains.find(domain => props.href.startsWith(domain)) !== undefined); const isExternal = computed(() => !isFauxInternal.value && props.href && EXTERNAL_URL_RE.test(props.href)); - - +const link = computed(() => { + if (props.rel === 'mvb' && props.href) return props.href; + return props.href ? normalizeLink(props.href) : undefined; +}); + diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 6426066..aca924e 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -19,9 +19,9 @@ const sidebarEnder = { { text: 'Other Doc Versions', items: [ - {text: 'stable', target: '_blank', link: '/v/stable/'}, - {text: 'edge', target: '_blank', link: '/v/edge/'}, - {text: 'see all versions', link: '/v/'}, + {rel: 'mvb', text: 'stable', target: '_blank', link: '/v/stable/'}, + {rel: 'mvb', text: 'edge', target: '_blank', link: '/v/edge/'}, + {rel: 'mvb', text: 'see all versions', link: '/v/'}, ], }, {text: 'Other Releases', link: 'https://github.com/lando/vitepress-theme-default-plus/releases'}, diff --git a/netlify.toml b/netlify.toml index d669bd7..12f77ad 100644 --- a/netlify.toml +++ b/netlify.toml @@ -34,13 +34,3 @@ [plugins.inputs] skipPatterns = [ ".rss", ".gif", ".jpg", 'x.com', 'twitter.com', '/v/' ] checkExternal = true - -# mvb redirects -[[redirects]] - from = "/v/:version/v/" - to = "/v/" - status = 301 -[[redirects]] - from = "/v/:first/v/:second/" - to = "/v/:second/" - status = 301 From ad9b93cef5c71d50a918fcbb3468b73527c27967 Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Tue, 1 Oct 2024 15:33:58 -0400 Subject: [PATCH 15/15] provide stealth rel=mvp attribute to help absolute path versioned doc sites part 2 --- bin/mvb.js | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/mvb.js b/bin/mvb.js index 7cc1349..e7dd3f2 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -92,7 +92,6 @@ const options = { ...argv, cacheDir: path.resolve(process.env?.NETLIFY === 'true' ? '/opt/build/cache' : siteConfig.cacheDir, '@lando', 'mvb'), tmpDir: path.resolve(os.tmpdir(), nanoid()), - // tmpDir: path.resolve(siteConfig.tempDir, nanoid()), }; debug('multiversion build from %o using resolved build options: %O', srcDir, options);