Giter VIP home page Giter VIP logo

Comments (17)

 avatar commented on September 1, 2024 1

Then even better than Hugo 😈

from nsm.

n-ham avatar n-ham commented on September 1, 2024

Hmmm, that must be caused by a bug, it should remove content/about.content with nsm rm about. I just tested it on my machine and it's working fine there.

What operating system are you on? How are you installing Nift? And what version do you have when you run nsm --version?

from nsm.

n-ham avatar n-ham commented on September 1, 2024

I just remembered from #14 that I'm pretty sure you're on Windows and may be doing this from C:\?

It's possible that nsm doesn't have the privileges to delete files from C:\? I think the desktop should be at like c:\Users\(username)\Desktop so try cd'ing to that before cloning, cd'ing and running nsm rm about. Alternatively if you really want to do it from C:\ and this is the problem when you go to open command prompt you can right click and open it as administrator.

Have you installed Nift through Chocolatey?

from nsm.

n-ham avatar n-ham commented on September 1, 2024

Maybe I should throw an error if Nift fails to remove a file.

from nsm.

 avatar commented on September 1, 2024

What operating system are you on?

Windows

How are you installing Nift?

curl -L -O \
https://github.com/nifty-site-manager/nsm/releases/download/v2.0.1/nsm.exe

And what version do you have when you run nsm --version?

$ nsm --version
Nift (aka nsm) v2.0.1

I think the desktop should be at like c:\Users\(username)\Desktop so try
cding to that before cloning

$ cd 'C:\Users\Steven'
$ nsm clone https://github.com/nsm-templates/simple-site.git
$ cd simple-site
$ ls content
about.content  index.content

$ nsm rm about
successfully removed about

$ ls content
about.content  index.content

from nsm.

n-ham avatar n-ham commented on September 1, 2024

Hmm, it looks like there might be a few problems with Windows. I will have a play and get back to you. Sorry about this.

from nsm.

n-ham avatar n-ham commented on September 1, 2024

Strange, I thought maybe the way I'm deleting files with C++ doesn't work on windows, but I just tested that with a simple C++ file and it seems to work on Windows no problem.

from nsm.

 avatar commented on September 1, 2024

a simple C++ file

I can test that if you want

from nsm.

n-ham avatar n-ham commented on September 1, 2024

I have found the bug I'm pretty sure.

It seems you can't do if(std::ifstream(dir-path)) on Windows to check if a directory exists, that works on unix (at least on linux).

At least for rm and untrack etc. I can just check if the file I'm about to remove exists (not sure why I was even checking the directory), however there are other times it also uses that I will need to sort something out for. I noticed it's also causing a bug with clone as well though, so might have to check a few things before putting an updated binary on github (and might even have to wait until the next version sorry, as it might be too many things to change both in the older version and the current version I'm working on).

from nsm.

n-ham avatar n-ham commented on September 1, 2024

From https://stackoverflow.com/questions/18100097/portable-way-to-check-if-directory-exists-windows-linux-c I might be able to use

#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>

int dirExists(const char *path)
{
    struct stat info;

    if(stat( path, &info ) != 0)
        return 0;
    else if(info.st_mode & S_IFDIR)
        return 1;
    else
        return 0;
}

from nsm.

n-ham avatar n-ham commented on September 1, 2024

I will fix it in the current version I'm working on and then put a copy of the binary for that somewhere you can play with. The new version might not be released for a little bit because I am working on adding programming language features to the template language. I will wrap up some of the stuff I'm working on and try to get out a new release sooner than I was planning to though because these are pretty big bugs on Windows. Thanks a lot for reporting them.

from nsm.

n-ham avatar n-ham commented on September 1, 2024

I'm looking forward to checking build times on 10k pages etc. once I finish making these changes because I just checked and this way of checking whether a file exists is like 3 times faster!

from nsm.

n-ham avatar n-ham commented on September 1, 2024

Already more than 3 times faster than Hugo at full builds and up to 15 times faster from having incremental builds, check out https://hugo-vs-nift.gitlab.io/ :)

Once Nift has lots of programming language features, many of which I'm hoping will be better than any other website generators, I don't think there'll be many ways left that anything else trumps Nift. And if I can find anything I'll be working on that too :)

from nsm.

n-ham avatar n-ham commented on September 1, 2024

It's definitely faster, it's hard to say how much though as I've already started adding in programming language features which might have slowed it down a bit compared to the last version. Thanks to this though the version that comes out with the programming features that should slow it more than anything will be faster than the release before it! Pretty happy about that..

from nsm.

 avatar commented on September 1, 2024

Glad to hear it, I like the fast and simple nature of this project

from nsm.

n-ham avatar n-ham commented on September 1, 2024

I just added nsm-fix.exe to the most recent GitHub release. Hopefully that has all the problems fixed for you. I will try to get a few things wrapped up so I can release a new version, most importantly to chocolatey and for people installing from source on Windows. Might still take a while though as I don't want to release something with programming language features that can't really be used from a lack of other features..

from nsm.

 avatar commented on September 1, 2024

confirmed fixed - thanks

from nsm.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.