How do I find files that are missing from visual studio projects?

前端 未结 11 640
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-31 01:59

Due to issues with merging etc, we have lots of project files that don’t contain all source code files that are within their folders.

Before I write a little tool, that

11条回答
  •  醉梦人生
    2021-01-31 02:25

    After reading there is no generic solution for this here on Stack Overflow, I created a NodeJS module this weekend to solve this problem:

    https://www.npmjs.com/package/check-vs-includes

    This is pretty generic, so I hope this helps others as well. It saves me a manual check of over 70 folders (500+ files) on every deploy. If I have some time I hope to improve some things, like documentation... But let me give a simple example right now.

    Simple example

    1. Install nodeJS (Works great on Windows too)
    2. npm install check-vs-includes

    3. Add a task for it and specify the files to check for.

    For instance add a gulpfile.js to your project:

    gulp.task('checkVSIncludes', function(cb) {
        checkVSIncludes(['/Content/**/*.less', '/app/**/*.js']);
    });
    

    This example checks that all .js and .less files in the specified folders are included in your project file. Notice that you can use glob's.

    1. Run the check; for the GULP example:

      gulp checkVSIncludes

    Check the source code for more options, it's all on GitHub (contributions are welcome ;)).

提交回复
热议问题