wispjs 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,10 +39,11 @@ export declare class GitSocket {
39
39
  *
40
40
  * @param dir The full directory path to pull
41
41
  * @param timeout In milliseconds, how long to wait before timing out
42
+ * @param resetHard When true, forces the pull by discarding local changes first
42
43
  *
43
44
  * @public
44
45
  */
45
- pull(dir: string, timeout?: number): Promise<GitPullResult>;
46
+ pull(dir: string, timeout?: number, resetHard?: boolean): Promise<GitPullResult>;
46
47
  /**
47
48
  * Clones a repository into the given parent directory.
48
49
  *
@@ -50,11 +50,16 @@ export class GitSocket {
50
50
  *
51
51
  * @param dir The full directory path to pull
52
52
  * @param timeout In milliseconds, how long to wait before timing out
53
+ * @param resetHard When true, forces the pull by discarding local changes first
53
54
  *
54
55
  * @public
55
56
  */
56
- async pull(dir, timeout = 10000) {
57
- return await this.withAuthRetry("git-pull", { directory: dir }, timeout);
57
+ async pull(dir, timeout = 10000, resetHard = false) {
58
+ const params = { directory: dir };
59
+ if (resetHard) {
60
+ params.reset_hard = true;
61
+ }
62
+ return await this.withAuthRetry("git-pull", params, timeout);
58
63
  }
59
64
  /**
60
65
  * Clones a repository into the given parent directory.
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "wispjs",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "type": "module",
5
5
  "description": "A package for interacting with Wisp-based server panels",
6
6
  "main": "dist/wisp.js",
7
7
  "types": "dist/wisp.d.ts",
8
8
  "scripts": {
9
9
  "build": "tsc",
10
+ "prepare": "npm run build",
10
11
  "build-docs": "typedoc wisp.ts wisp_api/index.ts wisp_socket/index.ts wisp_socket/git.ts wisp_socket/filesystem.ts wisp_api/apis/*"
11
12
  },
12
13
  "repository": {