sasjs / server

Build Apps on Base SAS
https://server.sasjs.io
MIT License
20 stars 3 forks source link

Is it possible to set an autoexec.sas file in dedicated directory? #117

Closed yabwon closed 2 years ago

yabwon commented 2 years ago

Hi Team!

First of all: Great Product! I love it!

Is it possible to set an autoexec.sas file in dedicated directory?

All the best Bart

allanbowe commented 2 years ago

Thanks @yabwon !

I think a user-specific auto-exec is a great idea. This would need to be saved at backend so that it can be available across different browser sessions.

This is probably a good point to enable home directories for users. Then, we can add the autoexec to the home dir, allowing the autoexec to be easily viewed and edited.

The implementation would therefore require:

When launching a SAS session (executor.ts), the autoexec.sas file is copied (if it exists) from the user folder to the session folder (as user-autoexec.sas).

image image

The SAS executor is also updated with the following code injected into the code.sas program: %inc "$(SAS_PATH)/sessions/$(sessionid)/user-autoexec.sas";

IMPORTANT - this behaviour should only happen for the /CODE/ExecuteSASCode API (not Stored Program requests)

saadjutt01 commented 2 years ago

With the latest(v0.3.2) version, you can set autoexec to ~/.sasjs-server/user-autoexec.sas in DESKTOP mode.