mirror of
https://github.com/dilllxd/gitfolio.git
synced 2024-08-14 22:28:09 +00:00
fail to run bug fix (#62)
This commit is contained in:
parent
af801b40f9
commit
cb5bba6ba0
3 changed files with 10 additions and 7 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -64,4 +64,5 @@ typings/
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
# Editor files and folders
|
# Editor files and folders
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
|
|
@ -10,8 +10,9 @@ const { getConfig, outDir } = require('./utils');
|
||||||
function convertToEmoji(text) {
|
function convertToEmoji(text) {
|
||||||
if (text == null) return;
|
if (text == null) return;
|
||||||
text = text.toString();
|
text = text.toString();
|
||||||
if (text.match(/(?<=:\s*).*?(?=\s*:)/gs) != null) {
|
var pattern = /(?<=:\s*).*?(?=\s*:)/gs
|
||||||
var str = text.match(/(?<=:\s*).*?(?=\s*:)/gs);
|
if (text.match(pattern) != null) {
|
||||||
|
var str = text.match(pattern);
|
||||||
str = str.filter(function (arr) {
|
str = str.filter(function (arr) {
|
||||||
return /\S/.test(arr);
|
return /\S/.test(arr);
|
||||||
});
|
});
|
||||||
|
|
9
run.js
9
run.js
|
@ -1,17 +1,18 @@
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const open = require('open');
|
const open = require('open');
|
||||||
const defaultBrowser = require('x-default-browser');
|
const defaultBrowser = require('x-default-browser');
|
||||||
|
const path = require('path');
|
||||||
const outDir = path.resolve('./dist/' || process.env.OUT_DIR);
|
const outDir = path.resolve('./dist/' || process.env.OUT_DIR);
|
||||||
const app = express();
|
const app = express();
|
||||||
app.use(express.static(`${outDir}/dist`));
|
app.use(express.static(`${outDir}`));
|
||||||
|
|
||||||
function runCommand(){
|
function runCommand(){
|
||||||
app.get('/',function(req,res){
|
app.get('/',function(req,res){
|
||||||
res.sendFile('/index.html');
|
res.sendFile('/index.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(3000);
|
app.listen(3000);
|
||||||
|
|
||||||
defaultBrowser(function (err, res) {
|
defaultBrowser(function (err, res) {
|
||||||
if(err) throw err;
|
if(err) throw err;
|
||||||
(async () => {
|
(async () => {
|
||||||
|
@ -23,4 +24,4 @@ function runCommand(){
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
runCommand
|
runCommand
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue