Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
holo-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xinkong
holo-web
Commits
a0df6db4
Commit
a0df6db4
authored
Aug 10, 2023
by
ninglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改打包工具依赖来源
parent
878f6a1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
1 deletion
+92
-1
build-dist.js
build-tools/tool/build-dist.js
+1
-1
node-file-util.js
build-tools/tool/node-file-util.js
+91
-0
No files found.
build-tools/tool/build-dist.js
View file @
a0df6db4
const
shell
=
require
(
"
shelljs
"
);
const
shell
=
require
(
"
shelljs
"
);
const
chalk
=
require
(
"
chalk
"
);
const
chalk
=
require
(
"
chalk
"
);
const
systemMap
=
require
(
"
../system
"
);
const
systemMap
=
require
(
"
../system
"
);
const
util
=
require
(
"
@unistrong
/node-file-util
"
);
const
util
=
require
(
"
.
/node-file-util
"
);
let
system
=
process
.
argv
.
splice
(
2
);
let
system
=
process
.
argv
.
splice
(
2
);
!
system
.
length
&&
(
system
=
Object
.
keys
(
systemMap
));
!
system
.
length
&&
(
system
=
Object
.
keys
(
systemMap
));
...
...
build-tools/tool/node-file-util.js
0 → 100644
View file @
a0df6db4
const
fs
=
require
(
"
fs
"
);
const
path
=
require
(
"
path
"
);
module
.
exports
=
{
isExists
(
url
)
{
return
fs
.
existsSync
(
url
);
},
getDir
(
url
)
{
return
fs
.
readdirSync
(
url
);
},
isDirectory
(
url
)
{
return
fs
.
statSync
(
url
).
isDirectory
();
},
forEachFolder
(
url
,
callback
)
{
if
(
this
.
isExists
(
url
))
{
callback
(
"
folderBefore
"
,
url
);
const
files
=
this
.
getDir
(
url
);
files
.
forEach
((
file
)
=>
{
const
curUrl
=
path
.
join
(
url
,
file
);
if
(
this
.
isDirectory
(
curUrl
))
{
this
.
forEachFolder
(
curUrl
,
callback
);
}
else
{
callback
(
"
file
"
,
curUrl
,
file
);
}
});
callback
(
"
folderAfter
"
,
url
);
}
},
deleteFile
(
url
)
{
fs
.
unlinkSync
(
url
);
},
deleteFolder
(
url
)
{
fs
.
rmdirSync
(
url
);
},
deleteCatalog
(
url
)
{
this
.
forEachFolder
(
url
,
(
type
,
urlname
,
filename
)
=>
{
if
(
type
===
"
file
"
)
{
this
.
deleteFile
(
urlname
);
}
if
(
type
===
"
folderAfter
"
)
{
this
.
deleteFolder
(
urlname
);
}
});
},
delete
(
url
)
{
if
(
this
.
isExists
(
url
))
{
if
(
this
.
isDirectory
(
url
))
{
this
.
deleteCatalog
(
url
);
}
else
{
this
.
deleteFile
(
url
);
}
}
},
copyFile
(
src
,
tar
)
{
if
(
this
.
isExists
(
src
))
{
fs
.
copyFileSync
(
src
,
tar
);
}
},
copyCatalog
(
src
,
tar
)
{
if
(
this
.
isExists
(
src
))
{
if
(
!
this
.
isExists
(
tar
))
{
this
.
createFolder
(
tar
);
}
const
files
=
this
.
getDir
(
src
);
files
.
forEach
((
file
)
=>
{
const
srcUrl
=
path
.
join
(
src
,
file
);
const
tarUrl
=
path
.
join
(
tar
,
file
);
if
(
this
.
isDirectory
(
srcUrl
))
{
this
.
copyCatalog
(
srcUrl
,
tarUrl
);
}
else
{
this
.
copyFile
(
srcUrl
,
tarUrl
);
}
});
}
},
copy
(
src
,
tar
)
{
if
(
this
.
isExists
(
src
))
{
if
(
this
.
isDirectory
(
src
))
{
this
.
copyCatalog
(
src
,
tar
);
}
else
{
this
.
copyFile
(
src
,
tar
);
}
}
},
createFolder
(
url
)
{
fs
.
mkdirSync
(
url
);
},
createFile
(
url
,
data
)
{
fs
.
writeFileSync
(
url
,
data
);
},
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment