Skip to content

Should hexo-cli package bundles with hexo-starter and hexo-theme-landscape? #236

@curbengh

Description

@curbengh

Recently I tried to test some plugins in a fresh Windows, I created a dummy blog with hexo init but forgot to install Git beforehand.

try {
await spawn('git', ['clone', '--recurse-submodules', '--depth=1', '--quiet', GIT_REPO_URL, target], {
stdio: 'inherit'
});
} catch (err) {
log.warn('git clone failed. Copying data instead');
await copyAsset(target);
}

The git command failed and copyAsset() is executed instead.

async function copyAsset(target) {
await copyDir(ASSET_DIR, target, { ignoreHidden: false });
}

That failed too because "assets/" folder (a submodule that points to hexo-starter) is not published.

I can think of two approaches:

  1. Publish "assets/" folder.
  2. Remove copyAsset() and check git existence before running L30: if (!commandExistsSync('git')) log.warn('Please install git')

@hexojs/core

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions