nativescript-community / plugin-seed

The plugin seed used for NativeScript Community plugins.
3 stars 2 forks source link

Merge App_Resources #8

Closed lochstar closed 3 years ago

lochstar commented 3 years ago

Hi guys,

I've starting using this project to migrate my plugin. The plugin installation requires some additions to App_Resources.

There doesn't seem to be a way of handling this case, I obviously want to avoid modifying the demo projects.

I suggest adding support to merge demo-snippets/App_Resources with the demo projects. This can be accomplished fairly painlessly using copySync from fs-extra.

// tools/setup.js
const appResourcesDemo = __dirname + '/../../App_Resources';
const appResourcesSnippets = __dirname + '/../../../demo-snippets/App_Resources';

// Copy App_Resources from snippets to demo
if (fs.existsSync(appResourcesSnippets) && fs.existsSync(appResourcesDemo)) {
    fs.copySync(appResourcesSnippets, appResourcesDemo, { recursive: true });
}

Thoughts?

keerl commented 3 years ago

Thanks for your input and sorry about the long delay in responding. This is a great idea. I have just added it.

https://github.com/nativescript-community/plugin-seed-tools/blob/35744aaf46b4746d6be5ac31348d8787b46b4d88/setup.js#L54