keycloakify 11.8.31 → 11.8.32

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.
@@ -1,3 +0,0 @@
1
- export declare function getIsKnownByGit(params: {
2
- filePath: string;
3
- }): Promise<boolean>;
@@ -1,3 +0,0 @@
1
- export declare function untrackFromGit(params: {
2
- filePath: string;
3
- }): Promise<void>;
@@ -1,45 +0,0 @@
1
- import * as child_process from "child_process";
2
- import {
3
- dirname as pathDirname,
4
- basename as pathBasename,
5
- join as pathJoin,
6
- sep as pathSep
7
- } from "path";
8
- import { Deferred } from "evt/tools/Deferred";
9
- import * as fs from "fs";
10
-
11
- export function getIsKnownByGit(params: { filePath: string }): Promise<boolean> {
12
- const { filePath } = params;
13
-
14
- const dIsKnownByGit = new Deferred<boolean>();
15
-
16
- let relativePath = pathBasename(filePath);
17
-
18
- let dirPath = pathDirname(filePath);
19
-
20
- while (!fs.existsSync(dirPath)) {
21
- relativePath = pathJoin(pathBasename(dirPath), relativePath);
22
-
23
- dirPath = pathDirname(dirPath);
24
- }
25
-
26
- child_process.exec(
27
- `git ls-files --error-unmatch '${relativePath.split(pathSep).join("/")}'`,
28
- { cwd: dirPath },
29
- error => {
30
- if (error === null) {
31
- dIsKnownByGit.resolve(true);
32
- return;
33
- }
34
-
35
- if (error.code === 1) {
36
- dIsKnownByGit.resolve(false);
37
- return;
38
- }
39
-
40
- dIsKnownByGit.reject(error);
41
- }
42
- );
43
-
44
- return dIsKnownByGit.pr;
45
- }
@@ -1,40 +0,0 @@
1
- import * as child_process from "child_process";
2
- import {
3
- dirname as pathDirname,
4
- basename as pathBasename,
5
- join as pathJoin,
6
- sep as pathSep
7
- } from "path";
8
- import { Deferred } from "evt/tools/Deferred";
9
- import { existsAsync } from "./fs.existsAsync";
10
-
11
- export async function untrackFromGit(params: { filePath: string }): Promise<void> {
12
- const { filePath } = params;
13
-
14
- const dDone = new Deferred<void>();
15
-
16
- let relativePath = pathBasename(filePath);
17
-
18
- let dirPath = pathDirname(filePath);
19
-
20
- while (!(await existsAsync(dirPath))) {
21
- relativePath = pathJoin(pathBasename(dirPath), relativePath);
22
-
23
- dirPath = pathDirname(dirPath);
24
- }
25
-
26
- child_process.exec(
27
- `git rm --cached '${relativePath.split(pathSep).join("/")}'`,
28
- { cwd: dirPath },
29
- error => {
30
- if (error !== null) {
31
- dDone.reject(error);
32
- return;
33
- }
34
-
35
- dDone.resolve();
36
- }
37
- );
38
-
39
- await dDone.pr;
40
- }