Ok so, Fleet is kinda new at the time of writing this…
https://www.jetbrains.com/help/fleet/install-on-a-remote-machine.html
Regardless, I am going to drop some configurations that I made:
Original idea came from here:
Is it possible to CD into a file?
Example of .fleet/run.json file
{
"configurations": [
{
"name": "Run C",
"type": "command",
"program": "/bin/bash",
"args": ["-cl", "fcd $FILE$ && gcc $FILE$ && ./a.out"]
},
{
"name": "Run Rust",
"type": "command",
"program": "/bin/bash",
"args": ["-cl", "fcd $FILE$ && cargo run"]
},
{
"name": "Run Python",
"type": "command",
"program": "/bin/bash",
"args": ["-c", "python3 $FILE$"]
}
]
}
Important Note: The .fleet file needs to be in the top directory of where all the code will exist
Also Important Note : $file$ takes into account the absolute working file, meaning that the file needs to be selected in the code editor.
In order for the configs above to work, we need to add a function to ~/.bashrc, which creates a cd that can move to the parent directory of a given file
function fcd () { [ -f "$1" ] && { cd "$(dirname "$1")"; } || { cd "$1"; } ; pwd; }
I also created a basic service unit file to have systemd handle the backend
[Unit]
Description=Jetbrain Fleet IDE Runtime
[Service]
User=samuel
WorkingDirectory=/home/samuel/codespace/fleet_runtime
ExecStart=/home/samuel/codespace/fleet_runtime/fleet launch workspace -- --auth=accept-everyone --publish --enableSmart>
[Install]
WantedBy=multi-user.target