Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exports log functionality and allows tarballing without ./start.js file #177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ exports.bundleFiles = function (startpath, args, files, opts, next)

// TODO should not be public,
// relied on by debug push code path
exports.tarCode = function (dirpath, pushdir, next)
exports.tarCode = function (dirpath, options, next)
{
options = Object(options);

var fstr = fstream.Reader({path: dirpath, type: "Directory"})
fstr.basename = '';

Expand All @@ -169,7 +171,7 @@ exports.tarCode = function (dirpath, pushdir, next)
hasIndex = true;
}
}).on('end', function () {
if (!hasIndex) {
if (!hasIndex && !options.node) {
logs.err('Command line generated bundle without an /_start.js file. Please report this error.');
process.exit(1);
}
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ exports.Tessel = tessel_usb.Tessel;
exports.findTessel = tessel_usb.findTessel;
exports.listDevices = tessel_usb.listDevices;
exports.bundleFiles = bundle.bundleFiles;
exports.tarCode = bundle.tarCode;
exports.logs = require('./logs');

require('./commands');
require('./script');