Skip to content

Commit

Permalink
add stealth ag feature to mvb
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Dec 3, 2024
1 parent a50e722 commit 480fb59
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion bin/mvb.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const {site} = siteConfig;

// build default options
const defaults = {
ag: site?.themeConfig?.multiVersionBuild?.ag ?? false,
base: site?.base ?? '/',
build: site?.themeConfig?.multiVersionBuild?.build ?? 'stable',
cache: site?.themeConfig?.multiVersionBuild?.cache ?? true,
Expand Down Expand Up @@ -111,7 +112,7 @@ const exec = createExec({cwd: options.tmpDir, debug});
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', '--force'];
const updateArgs = ['fetch', options.ag === false ? 'origin' : '--all', '--tags', '--no-filter', '--force'];
// if shallow then add to update refs
if (getStdOut('git rev-parse --is-shallow-repository', {trim: true}) === 'true') updateArgs.push('--unshallow');
// fetch
Expand All @@ -125,6 +126,8 @@ await exec('git', ['checkout', getBranch(), '--force']);
await exec('git', ['reset', 'HEAD', '--hard']);
// pull
await exec('git', ['pull', 'origin', getBranch()]);
// also get
if (options.ag !== false) await exec('git', ['merge', options.ag, '-X', 'theirs']);

// get extended version information
const {extended} = await getTags(options.tmpDir, options);
Expand Down
1 change: 1 addition & 0 deletions config/landov3.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export default function({
cache: true,
match: 'v[0-9].*',
satisfies: '>=1.0.0',
ag: 'edge',
},
nav: [],
sidebar: {},
Expand Down
1 change: 1 addition & 0 deletions config/landov4.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export default function({
cache: true,
match: 'v[0-9].*',
satisfies: '>=1.0.0',
ag: 'edge',
},
nav: [],
sidebar: {},
Expand Down
7 changes: 4 additions & 3 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default defineConfig({
description: 'The VitePress default theme with some MOARPOWAH!',
base: '/',
lang: 'en-US',
landoDocs: '3',
head: [
['link', {rel: 'icon', type: 'image/png', href: '/images/vitepress-lando-logo-mini.png'}],
['meta', {name: 'og:type', content: 'website'}],
Expand Down Expand Up @@ -187,9 +188,9 @@ export default defineConfig({
},
},
tagLink: '/all?tag=:tag-id',
search: {
provider: 'local',
},
// search: {
// provider: 'local',
// },
socialLinks: [
{
icon: 'github',
Expand Down

0 comments on commit 480fb59

Please sign in to comment.