libdragon 11.0.1 → 11.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/modules/actions/init.js +1 -1
- package/modules/actions/utils.js +13 -1
- package/package.json +1 -1
package/modules/actions/init.js
CHANGED
|
@@ -289,7 +289,7 @@ module.exports = /** @type {const} */ ({
|
|
|
289
289
|
usage: {
|
|
290
290
|
name: 'init',
|
|
291
291
|
summary: 'Create a libdragon project in the current directory.',
|
|
292
|
-
description: `Creates a libdragon project in the current directory. Every libdragon project will have its own docker container instance. If you are in a git repository or an NPM project, libdragon will be initialized at their root also marking there with a \`.libdragon\` folder. Do not remove the \`.libdragon\` folder and commit its contents if you are using source control, as it keeps persistent libdragon project information.
|
|
292
|
+
description: `Creates a libdragon project in the current directory. Every libdragon project will have its own docker container instance. If you are in a git repository or an NPM project, libdragon will be initialized at their root also marking there with a \`.libdragon\` folder. When running in a submodule, initializion will take place at that level rather than the superproject. Do not remove the \`.libdragon\` folder and commit its contents if you are using source control, as it keeps persistent libdragon project information.
|
|
293
293
|
|
|
294
294
|
By default, a git repository and a submodule at \`./libdragon\` will be created to automatically update the vendored libdragon files on subsequent \`update\`s. If you intend to opt-out from this feature, see the \`--strategy manual\` flag to provide your self-managed libdragon copy. The default behaviour is intended for users who primarily want to consume libdragon as is.
|
|
295
295
|
|
package/modules/actions/utils.js
CHANGED
|
@@ -242,7 +242,19 @@ async function initGitAndCacheContainerId(libdragonInfo) {
|
|
|
242
242
|
await runGitMaybeHost(libdragonInfo, ['init']);
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
const
|
|
245
|
+
const rootGitFolder = (
|
|
246
|
+
await spawnProcess('git', [
|
|
247
|
+
'rev-parse',
|
|
248
|
+
'--show-superproject-working-tree',
|
|
249
|
+
]).catch(() => {
|
|
250
|
+
// Probably host does not have git, can ignore
|
|
251
|
+
return '';
|
|
252
|
+
})
|
|
253
|
+
).trim();
|
|
254
|
+
|
|
255
|
+
// Fallback to the potential git root on the project root if there is no parent
|
|
256
|
+
// git project.
|
|
257
|
+
const gitFolder = path.join(rootGitFolder || libdragonInfo.root, '.git');
|
|
246
258
|
if (await dirExists(gitFolder)) {
|
|
247
259
|
await fs.writeFile(
|
|
248
260
|
path.join(gitFolder, CACHED_CONTAINER_FILE),
|