Is it possible to have your live sass compiler to read from multiple input source and compile into their respective output directories - sass

I am using django and I have this directory setup
/project
/apps
| /app1
| | /templates
| | /app1
| | app1.html
| | /static
| | /app1
| | /css (desired)
| | app1.css(desired)
| | /scss
| | _app1-partial.scss
| | app1.scss
| /app2
| /templates
| /app2
| app2.html
| /static
| /app2
| /css (desired)
| app2.css(desired)
| /scss
| _app2-partial.scss
| app2.scss
/templates
base.html
navbar.html
/static
| /images
| /css (desired)
| style.css(desired)
| /scss
| _partial.scss
| style.scss
/project
settings.py
manage.py
Is it possible that I can have a live sass compiler extension to compile multiple source scss inputs into multiple css output files?

I think I had it figure it out but I appreciate corrections for me to learn.
This is what I had before
"liveSassCompile.settings.formats": [
{
"format": "compressed",
"extensionName": ".css",
"savePath": "~/css",
"savePathReplacementPairs": null
}
],
"liveSassCompile.settings.includeItems": [
"/static/*.scss",
"/static/**/*.scss"
],
Changes I made
"liveSassCompile.settings.includeItems": [
"/static/*.scss", // for root static scss file
"/apps/**/static/**/*.scss" // for app specific scss file
],

Related

Laravel - How to run schedule in multiple packages

currently, i'm working with project that has some modules which need to run schedule job.
I want to take schedule job into Kernel of each module (not Kernel in app/Console directory).
I did like this Laravel 5 Package Scheduled Tasks but it only run on 1 module. The others did not run.
Can anybody please help me! Thanks
My source code has structure like this:
app
| Console
| | Commands
| | | Command.php
| | Kernel.php
bootstrap
...
Module
| Module 1
| | Console
| | | Commands
| | | | Command11.php
| | | | Command12.php
| | | Kernel.php
| Module 2
| | Console
| | | Commands
| | | | Command21.php
| | | | Command22.php
| | | Kernel.php

Does Jekyll provide a method for extending a master Sass file without importing it?

I am referencing a master base.scss for global styles while working on multiple sites in a single Jekyll project. My project directory looks like this:
project
|
+--_sass
| |
| +--base.scss
|
+--_site
| |
| +--apple
| | |
| | +--css
| | |
| | +--style.css
| |
| +--banana
| |
| +--css
| |
| +--style.css
|
+--apple
| |
| +--css
| |
| +--style.scss
|
|--banana
| |
| +--css
| |
| +--style.scss
This works well because each of the style.scss files uses #import to import the base.scss file, which allows me to #extend the base styles in turn. This of course duplicates the content of base.scss across each file that imports it.
I'm wondering if there's a way to compile base.scss to say _site/css/base.css, which I would reference from my shared header, while retaining access to its classes when editing my site-specific Sass.
Does Jekyll provide a method for referencing and extending Sass files without duplicating their contents in the build?
If I understand your question properly, the following arrangement should work just as fine:
project
|
+--_sass
| |
| +--base.scss
|
+--_css
| |
| +--main.scss
|
+--apples
| |
| +--css
| | |
| | +--style.css
/* css/main.scss */
---
---
#import "base";
/* apples/css/style.css */
/* No need of front matter dashes here if its not a sass file */
.my_class { color: blue; }
<!-- _site/index.html -->
<head>
[...]
<link rel="stylesheet" href="/css/main.css" />
<link rel="stylesheet" href="/apples/css/style.css" />
</head>

lftp upload files inside different folders

I need to upload files in different folders with same name, recursively to a remote folder. Here a example.
Local
|-app1-1
| |-src
| |-img
| |-static
| |-app1-2 <------Upload from this
| |-file1-1
| |-file1-2
|-app2-1
| |-src
| |-img
| |-static
| |-app2-2 <------Upload from this
| |-file2-1
| |-file2-2
Here the remote result I need.
Remote Result
|-folder1
|-folder2
|-folder3
|-static
| |-app1-2 <------Upload from this
| | |-file1-1
| | |-file1-2
| |
| |-app2-2 <------Upload from this
| | |-file2-1
| | |-file2-1
I have testing with scripts like this:
- >
lftp
-e "mirror
--include ^static/
--exclude ^\.git.*
-eRv $CI_PROJECT_DIR Remote Result/static; quit;"
sftp://$CREDENTIALS
But this generate a output not desired:
Remote Result
|-folder1
|-folder2
|-folder3
|-static
| |-app1-1 <------Upload from this
| | |-static
| | |-app1-2
| | |-file1
| | |-file2
...... (Same other folder)

Makefile - Deleting subdirectories of a directory

I am a complete Makefile newb, So I'm wondering how I would loop through a specific directory and remove specific subdirectories?
Say I have:
[app]
|
| - [src]
| |
| |- [foo]
| |
| |- [foo-bar]
| |
| |- [bar]
| |
| |- [baz]
|
How would I loop through src and :
remove foo
remove foo-bar
leave bar
remove baz
I have actually about 8 specific folders I wish to delete from src.
Any help is appreciated
clean:
rm -f /src/foo
rm -f /src/foo-bar
rm -f /src/baz

Listing the contents of .tgz within a .tgz

I have 300 directories with the following structure
Directory
|-- zipfile.tgz
| |-- anotherzip.tgz
| | |-- afurtherzip.tgz
| | | |-- ethernet1.txt
| | | |-- ethernet2.txt
| | | |-- ethernet3.txt
| | |-- files.txt
| |-- files.txt
|-- zipfile2.tgz
| |-- anotherzip.tgz
| | |-- afurtherzip.tgz
| | | |-- ethernet1.txt
| | | |-- ethernet2.txt
| | | |-- ethernet3.txt
| | |-- files.txt
| |-- files.txt
I need to grep the contents of the ethernetx.txt files and for any files containing 'abc=n' have it tell me the file path of the containing zipfile.tgz so i know where to find it.
Can anyone suggest a decent script / one liner i can use to achieve this? I dont want to have to recursively extrace every .tgz if i can avoid it but please let me know what you think.

Resources