I tried it but it didnt work unfortunately
in dart you can have:
- helper
- lib
- first_helper.dart
- function1
- dependencies
- helper <---symlink
In the pubspec.yaml for function1 you would have:
dependencies:
dart_appwrite: ^7.1.0
helper:
path: dependencies/helper
Got you
ya, the Appwrite CLI will resolve the symlink and include it in the tar.gz
That's cool <:appwriteupvote:899677724615016528>
Ahhh , I was hoping that
dependencies:
dart_appwrite: ^7.1.0
helper:
path: ../helper
Would work out of the box. Is there a specific reason why it doesnt?
What OS You're using?
what byawitz said:
When deploying function to the cloud only the code inside the function folder will be deployed.
Im using windows
Locally, and linux for prod. Im not sure, are symlinks the same on both systems?
Not exactly.
You'll need to create symlink so for your example
Linux: inside any of your functions run
ln -s ../helper helper
Windows: inside any of your functions run
mklink /d helper ../helper
Notice that the target and source folder are the opposite parameter in each OS
That will create an helper folder within your function folder
Then update your yaml to:
dependencies:
dart_appwrite: ^7.1.0
helper:
path: helper
In linux it will work as Steven suggested, I won't be able to test in Windows dev environment right now, But it should work, try and let us know
What im worried about is, that the symlink I created on a windows machine wont work when pushing it to github and pulling it onto my raspberry pi with linux
I will try it out and let you know
Mmm make sense yes,
That part I've testes and seems to work
The first one created in linux environment and the second in windows
Both seems to be working
It works! To be on the safe side, I created the symlink on my windows machine using WSL
Via the linux command ๐
<:appwriteupvote:899677724615016528>
Great!
[SOLVED] Share code across multiple functions
FYI: you can also adopt a monorepo/packaged repo vision to facilitate external code injection
Recommended threads
- Bulk feature status
Hi there, I am using version 1.7.4 self hosted and wanted to use the bulk operations in a dart function. I saw that in the dart_appwrite sdk version 16.1.0 it ...
- CORS preflight returns 500 on Dart funct...
Hey everyone ๐ Iโm running a Dart cloud function, Every time I respond to a preflight (OPTIONS) request, I get a 500 internal error, and the logs show: ```NoSu...
- execution failed
When executing an appwrite function, I'm getting a 500 error, but I don't see it in executions. This issue appeared today. Here's the appwrite function ID: 68b4...