@modernpoacher/deps 2.1.13 → 2.1.14
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/bin/common/index.mjs +16 -6
- package/package.json +1 -1
- package/src/common/git/index.mjs +54 -20
- package/src/index.mjs +16 -6
package/bin/common/index.mjs
CHANGED
|
@@ -91,15 +91,25 @@ export function getArgs () {
|
|
|
91
91
|
)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
function filter (v) {
|
|
95
|
+
const s = v.trim()
|
|
96
|
+
|
|
97
|
+
return Boolean(s)
|
|
98
|
+
}
|
|
99
|
+
|
|
94
100
|
export function use (key) {
|
|
95
101
|
const log = debug(`@modernpoacher/deps:${key}`)
|
|
96
102
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
function write (v) {
|
|
104
|
+
const s = v.trimEnd()
|
|
105
|
+
|
|
106
|
+
log(s)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return function use (value) {
|
|
110
|
+
value.split(String.fromCharCode(10))
|
|
111
|
+
.filter(filter)
|
|
112
|
+
.forEach(write)
|
|
103
113
|
}
|
|
104
114
|
}
|
|
105
115
|
|
package/package.json
CHANGED
package/src/common/git/index.mjs
CHANGED
|
@@ -59,8 +59,10 @@ log(`\`git\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
|
59
59
|
|
|
60
60
|
const trim = (v) => v.split(String.fromCharCode(10)).map((v) => v.trimEnd()).join(String.fromCharCode(10)).trim()
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
function filter (v) {
|
|
63
|
+
const s = v.trim()
|
|
64
|
+
|
|
65
|
+
return Boolean(s)
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
export function getIsDirectory (directory) {
|
|
@@ -69,15 +71,23 @@ export function getIsDirectory (directory) {
|
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
|
|
74
|
+
export function isFatal (s) {
|
|
75
|
+
return s.toLowerCase().startsWith('fatal: not a git repository')
|
|
76
|
+
}
|
|
77
|
+
|
|
72
78
|
export function use (key) {
|
|
73
79
|
const log = debug(`@modernpoacher/deps:${key}`)
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
function write (v) {
|
|
82
|
+
const s = v.trimEnd()
|
|
83
|
+
|
|
84
|
+
log(s)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return function use (value) {
|
|
88
|
+
value.split(String.fromCharCode(10))
|
|
89
|
+
.filter(filter)
|
|
90
|
+
.forEach(write)
|
|
81
91
|
}
|
|
82
92
|
}
|
|
83
93
|
|
|
@@ -86,12 +96,24 @@ export function out (key, directory) {
|
|
|
86
96
|
|
|
87
97
|
const isDirectory = getIsDirectory(directory)
|
|
88
98
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
function filterOut (v) {
|
|
100
|
+
const s = v.trim()
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
!isDirectory(s)
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function write (v) {
|
|
108
|
+
const s = v.trimEnd()
|
|
109
|
+
|
|
110
|
+
log(s)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return function out (value) {
|
|
114
|
+
value.split(String.fromCharCode(10))
|
|
115
|
+
.filter(filter).filter(filterOut)
|
|
116
|
+
.forEach(write)
|
|
95
117
|
}
|
|
96
118
|
}
|
|
97
119
|
|
|
@@ -100,12 +122,24 @@ export function err (key, directory) {
|
|
|
100
122
|
|
|
101
123
|
const isDirectory = getIsDirectory(directory)
|
|
102
124
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
125
|
+
function filterErr (v) {
|
|
126
|
+
const s = v.trim()
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
!isDirectory(s) && !isFatal(s)
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function write (v) {
|
|
134
|
+
const s = v.trimEnd()
|
|
135
|
+
|
|
136
|
+
log(s)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return function err (value) {
|
|
140
|
+
value.split(String.fromCharCode(10))
|
|
141
|
+
.filter(filter).filter(filterErr)
|
|
142
|
+
.forEach(write)
|
|
109
143
|
}
|
|
110
144
|
}
|
|
111
145
|
|
package/src/index.mjs
CHANGED
|
@@ -45,15 +45,25 @@ const log = debug('@modernpoacher/deps')
|
|
|
45
45
|
|
|
46
46
|
log(`\`deps\` (${VERSION} - ${PLATFORM}) is awake`)
|
|
47
47
|
|
|
48
|
+
function filter (v) {
|
|
49
|
+
const s = v.trim()
|
|
50
|
+
|
|
51
|
+
return Boolean(s)
|
|
52
|
+
}
|
|
53
|
+
|
|
48
54
|
export function use (key) {
|
|
49
55
|
const log = debug(`@modernpoacher/deps:${key}`)
|
|
50
56
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
function write (v) {
|
|
58
|
+
const s = v.trimEnd()
|
|
59
|
+
|
|
60
|
+
log(s)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return function use (value) {
|
|
64
|
+
value.split(String.fromCharCode(10))
|
|
65
|
+
.filter(filter)
|
|
66
|
+
.forEach(write)
|
|
57
67
|
}
|
|
58
68
|
}
|
|
59
69
|
|