CloudSlang / atom-cloudslang-package

Atom package for CloudSlang support
Apache License 2.0
7 stars 3 forks source link

Move flow in correct directory structure according to its namespace #67

Open levice14 opened 8 years ago

Moshisho commented 8 years ago

Hi @Bonczidai , Please provide more details on this enhancement.

levice14 commented 8 years ago

say you have a flow with namespace io.cloudslang.docker under folder io/cloudslang/cloud/paas -- folder structure does not match namespace -- should move it to io/cloudslang/docker

Moshisho commented 8 years ago

That part I understand, but do I show a notification or actually move the files to the correct folders on some event?

levice14 commented 8 years ago

it's up to your imagination - maybe you should trigger the action using a button or key combination -- it also depends on Atom capabilties

Moshisho commented 8 years ago

OK, Thanks! I'll check it out.

Moshisho commented 8 years ago

After researching this, main conclusion is that more time is needed ;) (it requires a change of how the package is loaded) : 1) Need to add lib folder and a coffee script file in it to run on package load. info info2 2) Direct to this file from package.json -> 'main' key (e.g. "main": "./lib/my-package",) 3) Subscribe to event of changing namespace. Perhaps this can help. 4) Add event handler for it and check for file existence. 5) In case of non matching file-path <-> namespace, notify user. I'm not sure if you can actually change the folder structure since it's javascript and files are in use, which can lead to problems... anyways, a notification is the way to go, IMHO.

levice14 commented 8 years ago

:+1: