diff --git a/lib/config.js b/lib/config.js index 82cfee1..512dd76 100644 --- a/lib/config.js +++ b/lib/config.js @@ -11,6 +11,8 @@ const DEFAULT_CONFIG = { 'algorithms', 'database', 'shell', + 'lcof', + 'lcci', 'concurrency' ], langs: [ diff --git a/lib/file.js b/lib/file.js index c2262df..5b40fdc 100644 --- a/lib/file.js +++ b/lib/file.js @@ -165,12 +165,16 @@ file.meta = function(filename) { // first look into the file data const line = this.data(filename).split('\n') .find(x => x.indexOf(' @lc app=') >= 0) || ''; - line.split(' ').forEach(function(x) { - const v = x.split('='); - if (v.length == 2) { - m[v[0]] = v[1].trim(); - } - }); + // line.split(' ').forEach(function(x) { + // const v = x.split('='); + // if (v.length == 2) { + // m[v[0]] = v[1].trim(); + // } + // }); + const reg = /app=(?.+?) id=(?.+?) lang=(?.+?)$/; + const res = reg.exec(line); + m.id = res.groups.id + m.lang = res.groups.lang // otherwise, look into file name if (!m.id || !m.lang) { diff --git a/package.json b/package.json index 93c650b..a65385e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "vsc-leetcode-cli", - "version": "2.8.0", + "name": "@haozibi/vsc-leetcode-cli", + "version": "2.8.1", "description": "A cli tool to enjoy leetcode!", "engines": { "node": ">=4"