exec-staged 0.1.1 → 0.1.3
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.
- package/README.md +1 -1
- package/dist/lib/constants.js +1 -1
- package/dist/lib/stage.js +2 -2
- package/package.json +1 -1
- package/src/lib/constants.ts +1 -1
- package/src/lib/stage.ts +2 -1
package/README.md
CHANGED
|
@@ -137,7 +137,7 @@ To filter files by name, add a `glob` filter (defaults to `'*'`):
|
|
|
137
137
|
{ task: 'prettier --write $FILES', glob: '*.{js,ts,json,md}' }
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
To filter files by git status, add a `diff` filter (defaults to `'
|
|
140
|
+
To filter files by git status, add a `diff` filter (defaults to `'AM'`; see [here](https://git-scm.com/docs/git-status#_short_format)):
|
|
141
141
|
|
|
142
142
|
```typescript
|
|
143
143
|
{ task: 'prettier --write $FILES', diff: 'A' }
|
package/dist/lib/constants.js
CHANGED
package/dist/lib/stage.js
CHANGED
|
@@ -90,7 +90,7 @@ export class Stage {
|
|
|
90
90
|
this.head = this.git(['rev-parse', 'HEAD']);
|
|
91
91
|
this.gitDir = this.git(['rev-parse', '--absolute-git-dir']);
|
|
92
92
|
this.patchPath = path.resolve(this.gitDir, 'patch.diff');
|
|
93
|
-
this.git(['status', '--porcelain'])
|
|
93
|
+
this.git(['status', '--porcelain', '--no-renames'])
|
|
94
94
|
.split('\n')
|
|
95
95
|
.filter((f) => f.length)
|
|
96
96
|
.forEach((f) => (this.status[f.slice(3)] = f.slice(0, 2)));
|
|
@@ -164,7 +164,7 @@ export class Stage {
|
|
|
164
164
|
if (interpolationIndex !== -1) {
|
|
165
165
|
const files = micromatch(Object.entries(this.status)
|
|
166
166
|
.filter(([, s]) => s.match(new RegExp(`^[${diff}]`)))
|
|
167
|
-
.map(([f]) => f), glob);
|
|
167
|
+
.map(([f]) => f), glob, { dot: true });
|
|
168
168
|
if (files.length === 0) {
|
|
169
169
|
this.logger.log(`➡️ No matching files, skipping task...`);
|
|
170
170
|
continue;
|
package/package.json
CHANGED
package/src/lib/constants.ts
CHANGED
package/src/lib/stage.ts
CHANGED
|
@@ -118,7 +118,7 @@ export class Stage {
|
|
|
118
118
|
this.gitDir = this.git(['rev-parse', '--absolute-git-dir']);
|
|
119
119
|
this.patchPath = path.resolve(this.gitDir, 'patch.diff');
|
|
120
120
|
|
|
121
|
-
this.git(['status', '--porcelain'])
|
|
121
|
+
this.git(['status', '--porcelain', '--no-renames'])
|
|
122
122
|
.split('\n')
|
|
123
123
|
.filter((f) => f.length)
|
|
124
124
|
.forEach((f) => (this.status[f.slice(3)] = f.slice(0, 2)));
|
|
@@ -211,6 +211,7 @@ export class Stage {
|
|
|
211
211
|
.filter(([, s]) => s.match(new RegExp(`^[${diff}]`)))
|
|
212
212
|
.map(([f]) => f),
|
|
213
213
|
glob,
|
|
214
|
+
{ dot: true },
|
|
214
215
|
);
|
|
215
216
|
|
|
216
217
|
if (files.length === 0) {
|