Skip to content

Commit 55eacc3

Browse files
committed
fix
1 parent c5f6b89 commit 55eacc3

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

lib/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const DEFAULT_CONFIG = {
1111
'algorithms',
1212
'database',
1313
'shell',
14+
'lcof',
15+
'lcci',
1416
'concurrency'
1517
],
1618
langs: [

lib/file.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,16 @@ file.meta = function(filename) {
165165
// first look into the file data
166166
const line = this.data(filename).split('\n')
167167
.find(x => x.indexOf(' @lc app=') >= 0) || '';
168-
line.split(' ').forEach(function(x) {
169-
const v = x.split('=');
170-
if (v.length == 2) {
171-
m[v[0]] = v[1].trim();
172-
}
173-
});
168+
// line.split(' ').forEach(function(x) {
169+
// const v = x.split('=');
170+
// if (v.length == 2) {
171+
// m[v[0]] = v[1].trim();
172+
// }
173+
// });
174+
const reg = /app=(?<app>.+?) id=(?<id>.+?) lang=(?<lang>.+?)$/;
175+
const res = reg.exec(line);
176+
m.id = res.groups.id
177+
m.lang = res.groups.lang
174178

175179
// otherwise, look into file name
176180
if (!m.id || !m.lang) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "vsc-leetcode-cli",
3-
"version": "2.8.0",
2+
"name": "@haozibi/vsc-leetcode-cli",
3+
"version": "2.8.1",
44
"description": "A cli tool to enjoy leetcode!",
55
"engines": {
66
"node": ">=4"

0 commit comments

Comments
 (0)