trapeze icon indicating copy to clipboard operation
trapeze copied to clipboard

Copy files

Open aktivdigital-frontend opened this issue 3 years ago • 4 comments
trafficstars

Hi!

Can I copy files with yaml?

For example, I want to copy google-services.json from root to android/app folder.

Thank you!

aktivdigital-frontend avatar Aug 02 '22 15:08 aktivdigital-frontend

Not yet but it's definitely easily doable.

How would you imagine this working? Something like:

copy:
  src: /absolute/path/to/file
  dest: ./

One question this prompts: should the paths be relative to the android or iOS project or absolute, or both?

mlynch avatar Aug 04 '22 16:08 mlynch

Not yet but it's definitely easily doable.

How would you imagine this working? Something like:

copy:
  src: /absolute/path/to/file
  dest: ./

One question this prompts: should the paths be relative to the android or iOS project or absolute, or both?

Thanks for reply!

Yes, I think it would be cool :) The path could be from project root.

aktivdigital-frontend avatar Aug 05 '22 06:08 aktivdigital-frontend

I also missed this feature earlier. At least for android res files, copying was already possible, but not for files in general. So for android I sort of tricked the res operation in copying my google-services.json file by using the realtive path to go outside the res folder: Screenshot 2022-08-09 at 15 17 31

And for iOS I had to use the more complicated way of manipulating all the values without copying a seperate file: Screenshot 2022-08-09 at 15 19 53

I think a source parameter for a copy operation should work the same way it does for the res operation of the android platform.

Crylion avatar Aug 09 '22 13:08 Crylion

@Crylion nice, appreciate the ingenuity ☺️ definitely something that can be easily added soon

mlynch avatar Aug 18 '22 18:08 mlynch

Hi @mlynch !

Thanks for update, but it don't works for me. I updated this package and when i ran it, it said this: [warn] Unsupported configuration option android.copy. Skipping

I use these versions:

kép

kép

Could you help me, please? Thank you!

aktivdigital-frontend avatar Sep 07 '22 06:09 aktivdigital-frontend

@mlynch @aktivdigital-frontend I can confirm that. While the version I built and tested for this PR worked fine, the released 5.0.2 does not seem to include the copy operation at all 🤔 Might something have go wrong with compilation, so that an old state was released on accident? The changes of https://github.com/ionic-team/trapeze/pull/97 did also not actually make it into the version 😅

Crylion avatar Sep 07 '22 06:09 Crylion

Try 5.0.3. Used the old release process again that doesn't build in advance. Annoying, will probably need to move to doing the releases in github actions at some point

mlynch avatar Sep 07 '22 15:09 mlynch

@mlynch It works! Thank you for this feature!

aktivdigital-frontend avatar Sep 07 '22 15:09 aktivdigital-frontend