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

Fallback to building from source #100

Open
wants to merge 3 commits into
base: main
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
13 changes: 12 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const BinWrapper = require('bin-wrapper');
const build = require('bin-build');
const spinner = require('simple-spinner');

const config = require('./config');
Expand Down Expand Up @@ -34,7 +35,17 @@ async function install(logLevel) {
spinner.stop();
logger.info(`Theme Kit path: ${pathToExecutable}`);
} catch (err) {
throw new Error(err);
spinner.stop();
console.log('Error using downloaded executable:', err.message);
console.log('Attempting to build from source...');
spinner.start();

cleanFile(pathToExecutable);
await build.url(`https://github.com/Shopify/themekit/archive/refs/tags/v${config.version}.tar.gz`, [
'make build GOBIN=' + __dirname + '/../bin',
'make install GOBIN=' + __dirname + '/../bin'
]);
spinner.stop();
}
}

Expand Down
Loading