Gassetic looking for file with _0 added to file name - gulp

In my gassetic.yml file I have the following
files:
app.css: # This is the output filename
- src/someBundle/app.scss
However when gassetic runs, I get an error saying src/someBundle/app_0.scss is missing.
If I create this file and edit it, its this app_0.scss that is compiled.
Why does gassetic / gulp look for this file when its not specified in my yml file?
Thanks

It adds index of the file in the folder to avoid overwritting.
I think this is a bug but you can fix it by adding autoRenaming: false to the dev environment. See Multiple Environments setup

Related

JMeter reads %3CEOF%3E from CSV file

I use CSV Data Set Config in JMeter to provide username/password data to testsuite. In some cases it reads %3CEOF%3E from file instead of data. File is located in /bin folder.
Structure of file:
username1,password1
username2,password2
There isn't any empty lines at the end of the file.
Recycle on EOF: True
Stop Thread on EOF: False
Although you should not be seeing this issue normally you can work it around by putting your request under the If Controller and setting the following condition using __groovy() function:
${__groovy(!vars.get('foo').equals('<EOF>'),)}
Replace foo with the variable reference name from the CSV Data Set Config.
I faced the exact same problem and ran into a solution by accident. Although the txt had no empty lines when opened with "notepad" when I opened the same txt file using "notepad++" I found an empty line. I removed it from notepad++ and saved and the problem was solved.

Include JSON file to build/output directory without import

Maybe the title is a bit strange, but I can't seem to find anything about on google.
Question: I have a folder that only contains .ts files and .json files.. Typescript compiles the .ts files and puts it into a separate directory (not as a bundle, just the directory structure 'as-is').
Src /
Workers /
[ModuleA.ts, ModuleA.json],
[ModuleB.ts, ModuleB.json],
[MobuleC.ts, ModuleC.json]
Most of the time I can just require('*.json') and the JSON file will be also placed in to build directory.
But now I have a situation, where importing the JSON will make no sense, because the JSON file gets updated every few seconds and I read the file with fs.readFile('*.json'), so I also don't want it floating around in the v8 cache (through require)
So how do I 'include' a JSON/None-Typescript file into the build, that is not explicitly being importing by either require or import?
For now I just used gulp to copy every .json file in the src folder over to the the respective dist/** folder.
But still find it strange typescript doesn't have something included for it..
Maybe you should checkout --resolveJsonModule, it's a newer feature of typescript.

Can't reference json file in root

I created a new Azure WebJobs project which is a console app. I placed a settings.json file in the root and I'm trying to access it using the following code but I keep getting an error that says it cannot locate the file. I think it's looking for it under Debug folder but I don't want to move the file there. How do I reference that file?
var config = new Configuration();
config.AddJsonFile("settings.json");
I tried "~/settings.json" but that didn't work either.
You need to identify if it's a deployment or runtime issue, per this article.
Make sure that your file is in fact getting deployed:
In VS, check that it has Copy to Output directory set to Copy if Newer
Use Kudu Console to look at the relevant WebJob folder under D:\home\site\wwwroot\App_Data\jobs\... and make sure that the json file made it to there next to the exe.
You can try to add your json file into your WebJob project's Resources as shown:
Remember to set the file type as Text and encoding to UTF-8.
In your code, you can easily access your json file as string as below:
// The Resources property depends on your actual file name being referenced
var settingsJson = Resources.settings;
Hope this helps!

Cisco switch: how to copy a whole file (or part) to access-list?

need help: I've found how to copy file with ACL rules to a switch as a file. But I can't figure out how to permit the data of my file to access-list.
Does anybody know how can I do it?
Many thanks!
copy flash:filename running-config
Will merge the file you have copied to the switches 'flash' filesystem into the running configuration.

Issue in creating Zip file using glob.glob

I am creating a Zip file from a folder (and subfolders). it works fine and creates a new .zip file also but I am having an issue while using glob.glob. It is reading all files from the desired folder (source folder) and writing to the new zip file but the problem is that it is, however, adding subdirectories, but not adding files form the subdirectories.
I am giving user an option to select the filename and path as well as filetype also (Zip or Tar). I don;t get any problem while creating .tar.gz file, but when use creates .zip file, this problem comes across.
Here is my code:
for name in (Source_Dir):
for name in glob.glob("/path/to/source/dir/*" ):
myZip.write(name, os.path.basename(name), zipfile.ZIP_DEFLATED)
myZip.close()
Also, if I use code below:
for dirpath, dirnames, filenames in os.walk(Source_Dir):
myZip.write(os.path.join(dirpath, filename) os.path.basename(filename))
myZip.close()
Now the 2nd code taks all files even if it inside the folder/ subfolders, creates a new .zip file and write to it without any directory strucure. It even does not take dir structure for main folder and simply write all files from main dir or subdir to that .zip file.
Can anyone please help me or suggest me. I would prefer glob.glob rather than the 2nd option to use.
Thanks in advance.
Regards,
Akash
Glob by design does not expand into subdirectories. It follows UNIX style path rules and expansions see the documentation for fnmatch for more information. If you want to get at the subdirectories you need to add it to the path. This example will get everything at one level down.
for name in (Source_Dir):
for name in glob.glob("/path/to/source/dir/*/*" ):
myZip.write(name, os.path.basename(name), zipfile.ZIP_DEFLATED)
myZip.close()
Doug Hellman has an excellent discussion here. If you are not using the pattern features of glob (like *.txt for all text files or *[0-9].txt for all text files that have a number before the extension) then I think your os.walk solution is better