utilium 0.5.1 → 0.5.2
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/dist/fs.js +2 -2
- package/package.json +1 -1
- package/src/fs.ts +2 -2
package/dist/fs.js
CHANGED
@@ -154,7 +154,7 @@ export class FolderMap extends FileMap {
|
|
154
154
|
export function gitCommitHash(repo = '.') {
|
155
155
|
repo = repo.replaceAll(/\/+/g, '/').replaceAll(/\/$/g, '');
|
156
156
|
const rev = fs
|
157
|
-
.readFileSync(repo + '
|
157
|
+
.readFileSync(repo + '/.git/HEAD')
|
158
158
|
.toString()
|
159
159
|
.trim();
|
160
160
|
if (rev.indexOf(':') === -1) {
|
@@ -162,7 +162,7 @@ export function gitCommitHash(repo = '.') {
|
|
162
162
|
}
|
163
163
|
else {
|
164
164
|
return fs
|
165
|
-
.readFileSync(repo + '
|
165
|
+
.readFileSync(repo + '/.git/' + rev.substring(5))
|
166
166
|
.toString()
|
167
167
|
.trim();
|
168
168
|
}
|
package/package.json
CHANGED
package/src/fs.ts
CHANGED
@@ -220,14 +220,14 @@ export class FolderMap extends FileMap<string> {
|
|
220
220
|
export function gitCommitHash(repo: string = '.'): string {
|
221
221
|
repo = repo.replaceAll(/\/+/g, '/').replaceAll(/\/$/g, '');
|
222
222
|
const rev = fs
|
223
|
-
.readFileSync(repo + '
|
223
|
+
.readFileSync(repo + '/.git/HEAD')
|
224
224
|
.toString()
|
225
225
|
.trim();
|
226
226
|
if (rev.indexOf(':') === -1) {
|
227
227
|
return rev;
|
228
228
|
} else {
|
229
229
|
return fs
|
230
|
-
.readFileSync(repo + '
|
230
|
+
.readFileSync(repo + '/.git/' + rev.substring(5))
|
231
231
|
.toString()
|
232
232
|
.trim();
|
233
233
|
}
|