Losant CLI - Folder Creation via Losant CLI results in '\css'\ leading slash

Hello,

Our developers are using the losant cli extensively. One thing we’ve noticed however is that any file creation in a folder they create on their machine (and then rely on losant cli to upload) results in a folder with a leading slash in the portal.

For example this \css folder in the screenshot below

This should just be a folder named ‘css’ , but the way that losant cli brings it across is as a folder named ‘\css’. This causes issues with building pages that look for files in that folder.

Has anyone else encountered this or found a way to prevent folders with leading slashes from being inadvertently created?

Hey @Kyle_Stokes2,

That is interesting. Do you know if the developer is using Windows, Mac, or Linux?

They are using Windows. We setup Windows 10 VMs.

I think I can replicate it. I had the same thing happen to me early on, but decided to just not upload/download files via the losant cli since it seemed to be prone to do this.

I think the steps to recreate are…

Open command prompt.
mkdir newFolder
cd newFolder
losant configure
<type first few letters of Losant Application name, hit enter>
Type Yes for ‘Download files now?’
Type Yes for ‘Export data tables now?’
code .
with the original command prompt, type losant files watch

back in vscode, create a new folder in the ‘files’ folder. This does not trigger anything in the losant files watch window.
Create a new file within that folder, add some content and save it, this will trigger it to upload the file and folder.

If you then refresh the folder in the Losant UI, you will see the folder was created with a leading slash.

Hey @Kyle_Stokes2,

Thanks for bringing this to our attention. I’m making a ticket right now to get this fixed. I’ll be sure to keep you up to date with anything I learn from our engineering team.

Thank you,
Heath

This is an old thread but we just pushed a fix for Windows paths. If you upgrade your local copy of the Losant CLI, file uploads in Losant should reflect the same folder structure you have on your computer.

1 Like