Open Yousuf-M-Hammad opened 2 years ago
So after messing around and changing the branch (a lot) turns out the problem is in the pubspec.yaml
where there should be :
executables:
package_name: # you can add a custom path here if you want though
And i guess the docs were right about "bin" directory but it left me wondering about global_packages
and intl_utils
I'm trying to develop a command line package so I followed these steps:
dart create --template=package-simple package_name
ordart create -t console-full package_name
(Both ends with the same results) then activating the package globally with:dart pub global activate --source path $(pwd)
note that I didn't find anything in the documentation about
--source path actual_path
but whenever I use the command only with--source actual_path
I get the following:"/Users/user/Desktop/Workspace/package_name" is not an allowed value for option "source".
So after successfully activating the package I tried to run it using:
package_name
But I got this:
zsh: command not found: package_name
Found out that the documentation here is outdated and after searching the local directory I found the actual directory is
global_packages
notbin
, and so I've changed it.Now when I try
package_name
I get:zsh: permission denied: package_name
After investigation I found that
package_name
is a directory in theglobal_packages
directory and it only containspubspec.lock
so I've triedchmod a+x
on the file and the directory with no avail.Further investigation the
global_packages
contained another packageintl_utils
inside I found:But running
intl_utils
on the terminal too get's me the same error:zsh: permission denied: intl_utils
I didn't install the package manually but the VS Code extension Flutter Intl did and it seems to work perfectly fine.Now I have two questions:
bin/my_package.dart
but it didn't go there, am I doing something wrong?I'm running dart through flutter: Flutter (Channel master, 2.13.0-0.0.pre.90, on macOS 12.3 21E230 darwin-x64, locale en-US)
dart --version
Dart SDK version: 2.17.0-202.0.dev (dev) (Thu Mar 10 20:55:41 2022 -0800) on "macos_x64"
OS: MacOs Monterey 12.3 (21E230)