Southclaws / sampctl

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.
GNU General Public License v3.0
241 stars 33 forks source link

Making consistency output path #450

Closed Se8870 closed 2 years ago

Se8870 commented 2 years ago

The reason why i've make this PR because currently sampctl only support for gamemode (both gamemode and library type).

This brings new type to ensure the output path to ../ for filterscript and gamemodes/ for both gamemode and libraries since creating new filterscript would require you to also have the same folder name as your fs.

You can also just revert adding gamemodes/ for output in pawn.json and close this PR and i'll make another pr about just removing "package" in generated pwn code.

Se8870 commented 2 years ago

@ADRFranklin

Se8870 commented 2 years ago

Thanks for this, a useful addition and some welcome improvements to the code! I just had one question regarding the default path of ../ for filterscripts that's all

Thanks for reviewing this, for ../ path let me explain.

The reason why ../ is because when you creating the filterscript, the contents should be in:

| -- server_root
     | -- Filterscript
          | -- my-system

So, doing ../ would place the .amx outside the folder name.

If i could make the path like this filterscripts/, then it should search the "server_files" not just "filterscript/my-system" folder. Unfortunately this is out of my reach :sweat_smile:

ADRFranklin commented 2 years ago

Could you please use absolute paths instead of relative paths. There are already code variables available in that code section that have absolute paths to the current working directory.

Se8870 commented 2 years ago

Could you please use absolute paths instead of relative paths. There are already code variables available in that code section that have absolute paths to the current working directory.

Yes, but when i tried to build it it creates the absolute path inside the server folder

sampctl/test  🍣 dev 📝 ×1🛤️  ×1
🕙 07:27:48 ❯ tree
.
├── announce
├── dependencies
│   ├── pawn-stdlib
│   └── samp-stdlib
├── filterscripts
├── gamemodes
├── home
│   └── yuusha
│       └── Documents
│           └── go-project
│               └── sampctl
│                   └── test
│                       └── gamemodes
│                           └── test.amx
├── pawn.json
├── README.md
├── samp03svr
├── samp-npc
├── server.cfg
└── test.pwn
ADRFranklin commented 2 years ago

Then however you have decided to write it is not correct. You can easily make this work, by using the correct utilities.

Se8870 commented 2 years ago

Then however you have decided to write it is not correct. You can easily make this work, by using the correct utilities.

Let me see what i can do with that... I mean, i can tweak some of its settings and make it working tbh.

Southclaws commented 2 years ago

Could you please use absolute paths instead of relative paths. There are already code variables available in that code section that have absolute paths to the current working directory.

This is wrong, you can't use absolute paths, it must be relative from the CWD. The question was more about why it was the parent, this may be confusing if the user runs sampctl from the root but that's likely less common than running it from within filterscripts.

This makes sense though, thanks @Se8870 I forgot about the extra directory within the filterscripts directory tree.

ADRFranklin commented 2 years ago

@Southclaws What do you mean you can't use absolute paths?

Se8870 commented 2 years ago

Could you please use absolute paths instead of relative paths. There are already code variables available in that code section that have absolute paths to the current working directory.

This is wrong, you can't use absolute paths, it must be relative from the CWD. The question was more about why it was the parent, this may be confusing if the user runs sampctl from the root but that's likely less common than running it from within filterscripts.

This makes sense though, thanks @Se8870 I forgot about the extra directory within the filterscripts directory tree.

you welcome 😁

so, about the absolute path, should i revert it and use "../" instead?

Se8870 commented 2 years ago

It seems like i've been staling for quite a time. I'll close this commit and make another one if i can figure it out how to do stuff because tbh i'm just new to this one.

Plus i can't fetch dev repo.