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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jag3dagster
Copy link

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

With `os.execute` being sandbox disabled, this offers an alternative for creating directories in Lua.
@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.

code/components/citizen-scripting-lua/src/LuaOS.cpp Outdated Show resolved Hide resolved
code/components/citizen-scripting-lua/src/LuaOS.cpp Outdated Show resolved Hide resolved
code/components/citizen-scripting-lua/src/LuaOS.cpp Outdated Show resolved Hide resolved
Removing the filesystem permission check as it fails when passed a full path instead of a relative path
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 ScRT: Lua Issues/PRs related to the Lua scripting runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants