Skip to content

Commit

Permalink
- support link option for linking from src to des.
Browse files Browse the repository at this point in the history
 - remove livescript header
  • Loading branch information
zbryikt committed Oct 1, 2021
1 parent f9d2da2 commit 09112ce
Show file tree
Hide file tree
Showing 7 changed files with 3,545 additions and 92 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Logs

## v0.0.16

- support `link` option for linking from src to des.
- remove livescript header


## v0.0.15

- use symlink instead hard copy when using `-l`.
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ you can use either string or object to list modules to be used. e.g.,

If object is used, it contains following fields:

- `name` - module name
- `browserify` - true/object if browserify this module.
- `name`: module name
- `browserify`: true/object if browserify this module.
- if it's an object, the object will be passed to browserify as it's option object.
- `dir` - subdir to copy in this module. default `dist` if not specified
- `dir`: subdir to copy in this module. default `dist` if not specified
- `link`: set true to use symlink instead of copying. default false.
- always false if `browserify` is set to true.


## Alternatives
Expand Down
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
rm -f cli.js
echo "#!/usr/bin/env node" > cli.js
./node_modules/.bin/lsc -cbp lib/main.ls >> cli.js
./node_modules/.bin/lsc -cbp --no-header lib/main.ls >> cli.js
chmod 755 cli.js
4 changes: 2 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env node
// Generated by LiveScript 1.6.0
var fs, path, os, fsExtra, browserify, yargs, argv, ret, localModule, useSymlink, fed, slice$ = [].slice;
fs = require('fs');
path = require('path');
Expand Down Expand Up @@ -94,7 +93,8 @@ fed = import$({
srcdir = root;
}
}
if (localModule) {
if (localModule || obj.link) {
fsExtra.removeSync(desdir);
fsExtra.ensureSymlinkSync(srcdir, desdir);
} else {
fsExtra.copySync(srcdir, desdir);
Expand Down
4 changes: 3 additions & 1 deletion lib/main.ls
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ fed = {root: '.', modules: []} <<< (JSON.parse(fs.read-file-sync "package.json"
else
srcdir = path.join(root, "dist")
if !fs.exists-sync(srcdir) => srcdir = root
if local-module => fs-extra.ensure-symlink-sync srcdir, desdir
if local-module or obj.link =>
fs-extra.remove-sync desdir
fs-extra.ensure-symlink-sync srcdir, desdir
else fs-extra.copy-sync srcdir, desdir
p = Promise.resolve!then -> console.log " -- #srcdir -> #desdir "
p.then ->
Expand Down
Loading

0 comments on commit 09112ce

Please sign in to comment.