Skip to content

Commit

Permalink
fix(tldr.ts): replace git pull with git fetch and git reset
Browse files Browse the repository at this point in the history
  • Loading branch information
lonr committed Nov 28, 2023
1 parent 98ec2f4 commit 1efc9c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export { pkg };
export type PKG = typeof pkg;

// handwrite the version as `package.json` will be inlined by rollup
pkg.version = '1.1.4';
pkg.version = '1.1.6';
const SPEC_VERSION = '1.5';
const PAGES_REPO = 'https://github.com/tldr-pages/tldr';
const ROOT_DIR = fileURLToPath(new URL('../', import.meta.url));
Expand Down
3 changes: 2 additions & 1 deletion src/tldr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export class Tldr {

private async pull() {
console.log('Updating pages...');
await exec('git pull', { cwd: this.dir });
await exec('git fetch', { cwd: this.dir });
await exec('git reset --hard origin/main', { cwd: this.dir });
console.log('Pages updated');
}

Expand Down

0 comments on commit 1efc9c9

Please sign in to comment.