PhpStorm File Watcher change output - compilation

I'm trying to output the compiled CSS to a different directory.
/project/scss/ to /project/css/
I've tried this, but get the error below:
Error: error No such file or directory - /Applications/MAMP/htdocs/project/public/css/style.scss
What are the Arguments and Output paths to refresh exactly for?

I got it working now with the following settings:
The only difference now is the Output paths to refresh field. It's the default now.

$FileParentDir$ contains the path of the parent SCSS file. So in our case it will be /project/scss. In order to make it work like you need, it is necessary to use $ProjectFileDir$ variable or (if you insist to use $FileParentDir$) $FileParentDir$/../ so it would go to an upper level directory.
If you will open any file in Editor and then go to Preferences | Tools | File Watchers > edit your file watcher settings > press Insert Macro button, you will see the list of all the variables with previews for currently opened file so you can see the values and build the arguments accordingly.
Note that Output paths to refresh also should be modified according to the Arguments path.

Related

sql loader without .dat extension

Oracle's sqlldr defaults to a .dat extension. That I want to override. I don't like to rename the file. When googled get to know few answers to use . like data='fileName.' which is not working. Share your ideas, please.
Error message is fileName.dat is not found.
Sqlloder has default extension for all input files data,log,control...
data= .dat
log= .log
control = .ctl
bad =.bad
PARFILE = .par
But you have to pass filename without apostrophe and dot
sqlloder pass/user#db control=control data=data
sqloader will add extension. control.ctl data.dat
Nevertheless i do not understand why you do not want to specify extension?
You can't, at least in Unix/Linux environments. In Windows you can use the trailing period trick, specifying either INFILE 'filename.' in the control file or DATA=filename. on the command line. WIndows file name handling allows that; you can for instance do DIR filename. at a command prompt and it will list the file with no extension (as will DIR filename). But you can't do that with *nix, from a shell prompt or anywhere else.
You said you don't want to copy or rename the file. Temporarily renaming it might be the simplest solution, but as you may have a reason not to do that even briefly you could instead create a hard or soft link to the file which does have an extension, and use that link as the target instead. You could wrap that in a shell script that takes the file name argument:
# set variable from correct positional parameter; if you pass in the control
# file name or other options, this might not be $1 so adjust as needed
# if the tmeproary file won't be int he same directory, need to be full path
filename=$1
# optionally check file exists, is readable, etc. but overkill for demo
# can also check temporary file does not already exist - stop or remove
# create soft link somewhere it won't impact any other processes
ln -s ${filename} /tmp/${filename##*/}.dat
# run SQL*Loader with soft link as target
sqlldr user/password#db control=file.ctl data=/tmp/${filename##*/}.dat
# clean up
rm -f /tmp/${filename##*/}.dat
You can then call that as:
./scriptfile.sh /path/to/filename
If you can create the link in the same directory then you only need to pass the file, but if it's somewhere else - which may be necessary depending on why renaming isn't an option, and desirable either way - then you need to pass the full path of the data file so the link works. (If the temporary file will be int he same filesystem you could use a hard link, and you wouldn't have to pass the full path then either, but it's still cleaner to do so).
As you haven't shown your current command line options you may have to adjust that to take into account anything else you currently specify there rather than in the control file, particularly which positional argument is actually the data file path.
I have the same issue. I get a monthly download of reference data used in medical application and the 485 downloaded files don't have file extensions (#2gb). Unless I can load without file extensions I have to copy the files with .dat and load from there.

How do I get PyCharm File Watcher to maintain my directory structure for SCSS output

I am currently working on getting automatic SCSS -> CSS conversion set up using PyCharm's File Watcher functionality. I am able to have the files output to another directory, but I cannot get them to do it relative to a specific directory. Currently, I have the following settings and relevant file tree:
Tree
|media/
|-c/
| |-css/
| |-folder/
| | |-file2.css
| --file.css
--src/
|-css/
|-folder/
| |-file2.scss
--file.scss
File Watcher Settings
Scope is the media/src/css/ directory and all subdirectories recursively
Arguments is --no-cache --update $FileName$:$ProjectFileDir$/media/c/$FileDirRelativeToProjectRoot$/$FileNameWithoutExtension$.css
Working directory is $ProjectFileDir$/media/src/css/
Output paths to refresh is $ProjectFileDir$/media/c/$FileDirRelativeToProjectRoot$/$FileNameWithoutExtension$.css
With these settings, when I update file2.scss, there is an error stating that media/c/media/src/css/folder does not exist, which is not where I want the file anyway.
The issue that I am having is that I would like to have all paths relative to the working directory root preserved (ie. media/src/css/folder -> media/c/css/folder, but all of my source SCSS files are under multiple folder levels from the project root and the tutorial only specifies how to maintain folder structure if you are compiling directly below the root, not a folder below the root. Does anyone know a way that my folder structure could be preserved so that anything under media/src/css would have the same relative output in media/c/css?
The CrazyCoder posted solution in another Question. It is hard to find, so I'm linking it. https://stackoverflow.com/a/15965088/2047157
Quoting:
The trick is to use $FileDirPathFromParent(dir)$ macro:

How to (easily) get current file path in Sublime Text 3

How to (easily) get current file path in Sublime Text 3
I don't often use ST console (I used it only once to install package manager), but I suppose it could be good way to :
get current file path like some kind pwd command.
But it doesn't work.
Does anyone know an easy way to get current file path?
to clipboard : better not a strict objective in the answer
not necessary by ST command, maybe package?
Right click somewhere in the file (not on the title tab) --> Copy file path
If you don't want to use the mouse, you could set up a keyboard shortcut as explained here https://superuser.com/questions/636057/how-to-set-shortcut-for-copy-file-path-in-sublime-text-3
To easily copy the current file path, add the following to Key Bindings - User:
{ "keys": ["ctrl+alt+c"], "command": "copy_path" },
Source
Key Bindings - User can be opened via the command palette (command + p on OSX)
Easy to understand using image. On Right Click you will get this.
Transcribed code in image for convenience:
import sublime, sublime_plugin, os
class CopyFilenameCommand(sublime_plugin.TextCommand):
def run(self, edit):
if len(self.view.file_name()) > 0:
filename = os.path.split(self.view.file_name())[1]
sublime.set_clipboard(filename)
sublime.status_message("Copied file name: %s" % filename)
def is_enabled(self):
return self.view.file_name()... # can't see
Mac OS X - Sublime Text 3
Right click > Copy File Path
A lot of these answers involve touching the mouse. Here's how to do get the path without any mouse clicks using SideBarEnhancements
Install SideBarEnhancements using PackageControl.
Click super + shift + P to open the command palette
In the command palette begin typing path until you see File: Copy Path
Select File: Copy Path
Now the path to file you are working in is copied into your clipboard.
There is a Sublime Package which gives your current file location inside a status bar. I just cloned them directly to my /sublime-text-3/Packages folder.
git clone git#github.com:shagabutdinov/sublime-shell-status.git ShellStatus;
git clone git#github.com:shagabutdinov/sublime-status-message.git StatusMessage;
You have to check/read the description on GitHub. Even it is listed in package control it would not install properly for me. You can actually edit the shell output as you want. If you have the right skills with python/shell.
Looks like this (Material Theme)
If you're like me and always click on items in the sidebar just to realize that copying the path only works when clicking in the editor area, have a look at the SideBarEnhancements package. It has a huge bunch of options to copy file paths in a variety of different ways.
Installation is available via Package Control (despite the webpage only mentions installation via manual download).
Note: The package “sends basic, anonymous statistics”. The webpage explains how to opt out from that.
Go to this link. The code in the link is given by robertcollier4.
Create a file named CpoyFileName.py or whatever you like with .py extension.
Save the file in Sublime Text 3\Packages\User folder. Then paste the above given key bindings in your Preferences: Key Bindings file.
Now, you can use the specified key bindings to copy just filename or total (absolute) filepath.
Please note that the filename or filepath do contain file extension.
Fastest Solution ( No Packages Needed + Comprehensive ):
Folder Path:
Folder in "Sidebar"
Right Click
"Find In Folder"
"Where" field contains everything you need
File Path:
File in current "Tab"
Right Click
"Copy File Path"

How to pass a file using Xcode in arguments

Sorry about my poor English, I hope you can understand what I'm describing
I know how to pass arguments, like -v, -c, etc
Edit Scheme > Run xxx > Arguments
In Termimal.app, when I type the following, it shows the correct result, as expected.
./C_Product < main.c
How should I do this in Xcode?
I tried to add argument < main.c, but it did not affect.
I already copied main.c file to
C_Productxxxxx -> Build -> Products -> Debug
with C_Product at the same place
I don't know of a way to get Xcode to pipe the contents of a file to std in automatically. However, you do have some other options. You could modify your program to take the filename as an argument, and then pass in the filename as an argument as you have above. So you could make -i <foo> be the name of the input file. (Or better yet, -input-file <foo>.)
Alternatively, you could modify your application to read from a file whose path is in an environment variable. So your app could call getenv("MY_INPUT_FILE"); and you could tell Xcode to set the value of "MY_INPUT_FILE" environment variable to the path of the input file in the scheme.

Creating empty directories / folders in InstallAnywhere 2011

I have a script which collected together a number of files to be installed. This includes a number of empty directories.
Previously I would use the D flag in the manifest file which would copy empty directories. However due to the way I generate the manifest files (as part of our build process) I can sometimes end up with two D entries with the same destination folder. e.g:
D;${A_LIB}/all/pysys/${PYSYS_VERSION}/lib/python2.7/site-packages;./third_party/python/lib/python2.7/site-packages;COMMON;${UNIX}
D;${A_LIB_BT}/python/${PYTHON_VERSION};./third_party/python;COMMON;${ALL}
This causes InstallAnywhere to fail to build the installer.
To get around this I rewrote the manifest generation code to parse the directories previously pointed to by a D and replace the D entry with F entries for each file in the directory.
Unfortunately this will not include empty directories (which we may / may not need in the installer but in general it's just safer to create them than have some piece of code fail because they're not there).
I've tried the following in the manifest. Reference, Reference3 and Reference4 are empty, Reference2 contains a single directory (which is itself empty). Only Reference2 is present in the install - the other three which are empty directories seem to get excluded.
D,$IA_PROJECT_DIR$/samples/pysys/cor_002/Reference,./samples/pysys/cor_002/Reference
D,$IA_PROJECT_DIR$/samples/pysys/cor_002/Reference2,./samples/pysys/cor_002/Reference2
D,$IA_PROJECT_DIR$/samples/pysys/cor_002/Reference3/.,./samples/pysys/cor_002/Reference3/.
D,$IA_PROJECT_DIR$/samples/pysys/cor_002/Reference4/../Reference4,./samples/pysys/cor_002/Reference4/../Reference4
I've also tried increasing the log level but this has not revealed anything. Is there a way to increase this log level?
export LAX_DEBUG=true
Any suggestions?
DISCLAIMER: I've cross posted this to InstallAnywhere's forums but I will do my best to keep the answers in sync and spread the knowledge.
I can't speak to your manifest challenges. However, my first thought is to change the manifest generator to be sensitive to duplicate output locations -- maybe by storing them in a Map or Set -- and then handling collisions when they occur by failing the build or adjusting the output location(s).
On the other hand, I can tell you how to increase the verbosity of your installer.
Make the installer more verbose by adding:
-Dlax.debug.all=true -Dlax.debug.level=3
to Project > JVM Settings > Installer Settings (tab) > Optional Installer Arguments > Additional Arguments. You'll want to remove these before you ship. You can also add these to the command line when you start the installer. Level values of 4 and 5 work, too, and are even more verbose.
You can also make your installer print its progress to the console by going to Project > JVM Settings > Log Settings. Here, uncheck Include debug output (stderr and stdout). Then enter the word console in Send stderr to: and Send stdout to:. Rather than console, you can also set a specific file name. You'll also want to undo these settings before you ship.
The solution turns out to be so blindingly simple that I never tried it.
To get EMPTY directories installed by Install Anywhere you have to specify the directories as files in the manifest. So with the following directory structure:
Reference <empty>
Reference2
testdir <empty>
Reference3 <empty>
Reference4 <empty>
You need to specify the entries in the manifest as F. Specifying then as D will only result in the "Reference2" directory being included.
F,$IA_PROJECT_DIR$/samples/pysys/cor_002/Reference,./samples/pysys/cor_002/Reference
F,$IA_PROJECT_DIR$/samples/pysys/cor_002/Reference2,./samples/pysys/cor_002/Reference2
F,$IA_PROJECT_DIR$/samples/pysys/cor_002/Reference3/.,./samples/pysys/cor_002/Reference3/.
F,$IA_PROJECT_DIR$/samples/pysys/cor_002/Reference4/../Reference4,./samples/pysys/cor_002/Reference4/../Reference4
Sorry to answer my own question, really wasn't the plan!

Resources