Skip to content

Commit

Permalink
- use symlink instead hard copy when using -l.
Browse files Browse the repository at this point in the history
  • Loading branch information
zbryikt committed Sep 22, 2021
1 parent 518afe2 commit 12899ad
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Logs

## v0.0.15

- use symlink instead hard copy when using `-l`.


## v0.0.14

- add `local` option for installing frontend modules from local repo.
Expand Down
10 changes: 8 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ fed = import$({
}
maindir = path.join(fed.root, name, "main");
fsExtra.removeSync(desdir);
fsExtra.ensureDirSync(desdir);
if (!localModule) {
fsExtra.ensureDirSync(desdir);
}
if (obj.browserify) {
p = new Promise(function(res, rej){
var b;
Expand All @@ -92,7 +94,11 @@ fed = import$({
srcdir = root;
}
}
fsExtra.copySync(srcdir, desdir);
if (localModule) {
fsExtra.ensureSymlinkSync(srcdir, desdir);
} else {
fsExtra.copySync(srcdir, desdir);
}
p = Promise.resolve().then(function(){
return console.log(" -- " + srcdir + " -> " + desdir + " ");
});
Expand Down
5 changes: 3 additions & 2 deletions lib/main.ls
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fed = {root: '.', modules: []} <<< (JSON.parse(fs.read-file-sync "package.json"
else desdir = path.join(fed.root, name, version)
maindir = path.join(fed.root, name, "main")
fs-extra.remove-sync desdir
fs-extra.ensure-dir-sync desdir
if !local-module => fs-extra.ensure-dir-sync desdir
if obj.browserify =>
p = new Promise (res, rej) ->
b = browserify(if typeof(obj.browserify) == \object => obj.browserify)
Expand All @@ -65,7 +65,8 @@ fed = {root: '.', modules: []} <<< (JSON.parse(fs.read-file-sync "package.json"
else
srcdir = path.join(root, "dist")
if !fs.exists-sync(srcdir) => srcdir = root
fs-extra.copy-sync srcdir, desdir
if local-module => fs-extra.ensure-symlink-sync srcdir, desdir
else fs-extra.copy-sync srcdir, desdir
p = Promise.resolve!then -> console.log " -- #srcdir -> #desdir "
p.then ->
fs-extra.remove-sync maindir
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"cli.js"
],
"description": "Frontend dependency installer",
"version": "0.0.14",
"version": "0.0.15",
"homepage": "https://github.com/plotdb/fedep",
"repository": {
"type": "git",
Expand Down

0 comments on commit 12899ad

Please sign in to comment.