Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(citizen-scripting-lua): Add os.createdir function #3129

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

jag3dagster
Copy link
Contributor

Goal of this PR

With os.execute being sandbox disabled, this offers an alternative for creating directories in Lua.

How is this PR achieving the goal

LuaOSCreateDir taps into and works with the VFS system directly to offer a more concise solution for creating directories instead of leaving os.execute open for anything and everything.

This PR applies to the following area(s)

Server, ScRT: Lua

Successfully tested on

Game builds: ..

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

@github-actions github-actions bot added ScRT: Lua Issues/PRs related to the Lua scripting runtime invalid Requires changes before it's considered valid and can be (re)triaged labels Feb 5, 2025
Copy link
Contributor

@FabianTerhorst FabianTerhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just small changes for consistency with the vfs.

@jag3dagster
Copy link
Contributor Author

Is there any additional feedback for this PR?

@FabianTerhorst FabianTerhorst added ready-to-merge This PR is enqueued for merging and removed invalid Requires changes before it's considered valid and can be (re)triaged ScRT: Lua Issues/PRs related to the Lua scripting runtime labels Feb 20, 2025
@DaniGP17
Copy link
Contributor

I think you have to squash the commits before they merge this

@FabianTerhorst
Copy link
Contributor

FabianTerhorst commented Feb 20, 2025

I think you have to squash the commits before they merge this

Yes @prikolium-cfx

With `os.execute` being sandbox disabled, this offers an alternative for creating directories in Lua.

updates for vfs consistency

removing permissions check

Removing the filesystem permission check as it fails when passed a full path instead of a relative path

add findclose calls
@github-actions github-actions bot added the ScRT: Lua Issues/PRs related to the Lua scripting runtime label Feb 20, 2025
@jag3dagster
Copy link
Contributor Author

Changes squashed.

@FabianTerhorst
Copy link
Contributor

Changes squashed.

Thank you.

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Feb 20, 2025
@prikolium-cfx prikolium-cfx merged commit f563638 into citizenfx:master Feb 21, 2025
2 of 6 checks passed
@jag3dagster jag3dagster deleted the feat-add-createdir branch February 21, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged ready-to-merge This PR is enqueued for merging ScRT: Lua Issues/PRs related to the Lua scripting runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants