core build -o <dir>/ ignores package name
Describe the bug
In a package foo,
The command core build -o target/ produces an executable at ./target/target.
The command go build -o foo/ produces ./target/foo, which is what I prefer.
The command core build -o target/bar produces ./target/bar/bar, which is just wrong, it should be ./target/bar, since the path doesn't end with a slash.
How to reproduce
```shell
$ ll target
total 10
drwxrwxr-x 2 anon anon 2 Apr 12 18:12 ./
drwxrwxr-x 6 anon anon 9 Apr 12 18:11 ../
------------------------------------------------ ~/s/g/c/t/tic-tac-toe ------------------------------------------------ (main|✔) --
$ go build -o target/
------------------------------------------------ ~/s/g/c/t/tic-tac-toe ------------------------------------------------ (main|…) --
$ ll target
total 22359
drwxrwxr-x 2 anon anon 3 Apr 12 18:12 ./
drwxrwxr-x 6 anon anon 9 Apr 12 18:11 ../
-rwxrwxr-x 1 anon anon 38652008 Apr 12 18:12 tic-tac-toe*
------------------------------------------------ ~/s/g/c/t/tic-tac-toe ------------------------------------------------ (main|…) --
$ core build -o target/
core build succeeded
------------------------------------------------ ~/s/g/c/t/tic-tac-toe ------------------------------------------------ (main|…) --
$ ll target
total 36884
drwxrwxr-x 2 anon anon 4 Apr 12 18:13 ./
drwxrwxr-x 6 anon anon 9 Apr 12 18:11 ../
-rwxrwxr-x 1 anon anon 27636184 Apr 12 18:13 target*
-rwxrwxr-x 1 anon anon 38652008 Apr 12 18:12 tic-tac-toe*
------------------------------------------------ ~/s/g/c/t/tic-tac-toe ------------------------------------------------ (main|…) --
$ core build -o target/argle
core build succeeded
------------------------------------------------ ~/s/g/c/t/tic-tac-toe ------------------------------------------------ (main|…) --
$ ll -R target
target:
total 36885
drwxrwxr-x 3 anon anon 5 Apr 12 18:18 ./
drwxrwxr-x 6 anon anon 9 Apr 12 18:11 ../
drwxrwxr-x 2 anon anon 3 Apr 12 18:18 argle/
-rwxrwxr-x 1 anon anon 27636184 Apr 12 18:13 target*
-rwxrwxr-x 1 anon anon 38652008 Apr 12 18:12 tic-tac-toe*
target/argle:
total 14527
drwxrwxr-x 2 anon anon 3 Apr 12 18:18 ./
drwxrwxr-x 3 anon anon 5 Apr 12 18:18 ../
-rwxrwxr-x 1 anon anon 27636184 Apr 12 18:18 argle*
------------------------------------------------ ~/s/g/c/t/tic-tac-toe ------------------------------------------------ (main|…) --
$
### Platform
linux, ubuntu,
@bobhy Thank you for filing this issue. I can see why that incorrect behavior is happening, and I can working on fixing this when I have the time. In the meantime, you can use go build to get the behavior you want, since the main advantage of the core tool is for mobile and web platforms, packaging for deployment (core pack), and convenient running (core run). Please let me know if you have any questions.